diff --git a/docs/assets/site.css b/docs/assets/site.css new file mode 100644 index 0000000..bf4762d --- /dev/null +++ b/docs/assets/site.css @@ -0,0 +1 @@ +*{box-sizing:border-box}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.6;color:#1f2937;background:#fff}body{margin:0}a{color:#2563eb}header{border-bottom:1px solid #e5e7eb;background:#f8fafc}nav{max-width:1040px;margin:auto;padding:1rem 1.25rem;display:flex;justify-content:space-between;gap:1rem;align-items:center}nav span{display:flex;gap:1rem;flex-wrap:wrap}.brand{font-weight:700;text-decoration:none;color:#111827}main{max-width:1040px;margin:auto;padding:2rem 1.25rem 4rem}.hero{padding:3rem 0 2rem}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:.82rem;font-weight:700;color:#475569}.lead{font-size:1.25rem;max-width:760px}h1{font-size:clamp(2.2rem,6vw,4rem);line-height:1.05;margin:.3rem 0 1rem}h2{margin-top:2.4rem}h3{margin-top:0}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1rem}.grid article{border:1px solid #e5e7eb;border-radius:12px;padding:1.2rem;background:#f8fafc}.button{display:inline-block;padding:.7rem 1rem;border-radius:8px;background:#111827;color:white;text-decoration:none;margin:.25rem .35rem .25rem 0}.button.secondary{background:#475569}code,pre{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}pre{overflow:auto;padding:1rem;border-radius:10px;background:#111827;color:#f8fafc}table{width:100%;border-collapse:collapse;margin-top:1rem}th,td{padding:.7rem;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:top}footer{border-top:1px solid #e5e7eb;padding:2rem 1.25rem;color:#64748b}footer p{max-width:1040px;margin:auto}@media(max-width:640px){nav{align-items:flex-start;flex-direction:column}.hero{padding-top:2rem}table{font-size:.92rem}} \ No newline at end of file diff --git a/docs/diagnostics.html b/docs/diagnostics.html new file mode 100644 index 0000000..b71f48c --- /dev/null +++ b/docs/diagnostics.html @@ -0,0 +1,24 @@ + + + + + PureSharp Diagnostics | RT, LVP, and FluentIf Roslyn Rules + + + +
+

PureSharp diagnostics

PureSharp exposes seven documented diagnostics across referential transparency, local-variable purity, naming, and FluentIf validation.

+ + + + + + + + +
IDPurposeDefault
RT0001Static mutable field access in [PureMethod]Error
RT0002Non-pure method call in [PureMethod]Error
RT0003I/O operation in [PureMethod]Error
LVP0001Reassignment to an immutable localError
LVP0002Immutable local missing declaration-time initializationError
LVP0003Suggestion for an effectively immutable localWarning
FIF0001FluentIf chain not terminated with .Else(...)Error
+

Configuration

[*.cs]
+dotnet_diagnostic.RT0001.severity = error
+dotnet_diagnostic.LVP0003.severity = warning
+

For the complete diagnostic contract, triggering conditions, compatibility rules, and message semantics, read docs/DIAGNOSTICS.md.

+
\ No newline at end of file diff --git a/docs/features.html b/docs/features.html new file mode 100644 index 0000000..58e51ee --- /dev/null +++ b/docs/features.html @@ -0,0 +1,16 @@ + + + + + PureSharp Features | C# Purity, Immutability, and FluentIf + + + +
+

PureSharp features

+

PureMethod checks

Annotate methods with [PureMethod] to ask PureSharp to verify selected referential-transparency constraints. The analyzer reports mutable static field access, calls to methods that are not known to be pure, and I/O operations inside marked methods.

+

Immutable local variables

PureSharp uses an explicit naming convention for immutable locals: names beginning with an underscore are treated as immutable variables. They must be initialized at declaration and cannot be reassigned. Effectively immutable ordinary locals can also receive a naming suggestion.

+

FluentIf

Fluent.If provides expression-oriented conditional flow. The analyzer verifies that a chain is terminated with .Else(...), preventing incomplete fluent conditions from becoming unnoticed logic errors.

+

Roslyn-native workflow

PureSharp diagnostics appear during normal IDE analysis and dotnet build. Severity can be configured with standard dotnet_diagnostic.<ID>.severity settings in .editorconfig.

+

Project components

+
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..c4f9a5f --- /dev/null +++ b/docs/index.html @@ -0,0 +1,21 @@ + + + + + + PureSharp | C# Roslyn Analyzer for Referential Transparency and Immutability + + + + + +
+
+

Functional programming support for C#

PureSharp

A Roslyn-based toolset that brings compile-time checks for referential transparency, local-variable immutability, and safer functional-style control flow to C#.

PureSharp helps developers make purity and immutability explicit and mechanically verifiable instead of relying only on conventions and code review.

Get PureSharp on NuGet View on GitHub

+

What PureSharp checks

Referential transparency

Methods marked with [PureMethod] are checked for mutable static state, non-pure calls, and I/O operations.

Immutable local variables

Locals using PureSharp's underscore convention can be required to initialize once and never be reassigned.

Fluent conditional flow

Fluent.If chains are checked so incomplete conditional expressions do not silently escape validation.

+

Why use it?

C# supports functional programming techniques, but the language does not mechanically enforce referential transparency or immutable local variables. PureSharp uses Roslyn diagnostics to turn selected functional-programming constraints into build-time feedback.

+

Open source and configurable

Diagnostics use standard .editorconfig severity controls. PureSharp is MIT licensed and its analyzer behavior is documented in a versioned diagnostic contract.

+
+ + + diff --git a/docs/robots.txt b/docs/robots.txt new file mode 100644 index 0000000..8f647d2 --- /dev/null +++ b/docs/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://mao2009.github.io/PureSharp/sitemap.xml diff --git a/docs/sitemap.xml b/docs/sitemap.xml new file mode 100644 index 0000000..52bae75 --- /dev/null +++ b/docs/sitemap.xml @@ -0,0 +1,6 @@ + + + https://mao2009.github.io/PureSharp/ + https://mao2009.github.io/PureSharp/features.html + https://mao2009.github.io/PureSharp/diagnostics.html +