Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/assets/site.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions docs/diagnostics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>PureSharp Diagnostics | RT, LVP, and FluentIf Roslyn Rules</title>
<meta name="description" content="Reference overview for PureSharp Roslyn diagnostics covering referential transparency, immutable local variables, naming guidance, and FluentIf validation in C#.">
<link rel="canonical" href="https://mao2009.github.io/PureSharp/diagnostics.html"><link rel="stylesheet" href="assets/site.css">
</head>
<body><header><nav><a class="brand" href="./">PureSharp</a><span><a href="features.html">Features</a><a href="diagnostics.html">Diagnostics</a><a href="https://github.com/mao2009/PureSharp">GitHub</a></span></nav></header>
<main><h1>PureSharp diagnostics</h1><p class="lead">PureSharp exposes seven documented diagnostics across referential transparency, local-variable purity, naming, and FluentIf validation.</p>
<table><thead><tr><th>ID</th><th>Purpose</th><th>Default</th></tr></thead><tbody>
<tr><td>RT0001</td><td>Static mutable field access in <code>[PureMethod]</code></td><td>Error</td></tr>
<tr><td>RT0002</td><td>Non-pure method call in <code>[PureMethod]</code></td><td>Error</td></tr>
<tr><td>RT0003</td><td>I/O operation in <code>[PureMethod]</code></td><td>Error</td></tr>
<tr><td>LVP0001</td><td>Reassignment to an immutable local</td><td>Error</td></tr>
<tr><td>LVP0002</td><td>Immutable local missing declaration-time initialization</td><td>Error</td></tr>
<tr><td>LVP0003</td><td>Suggestion for an effectively immutable local</td><td>Warning</td></tr>
<tr><td>FIF0001</td><td>FluentIf chain not terminated with <code>.Else(...)</code></td><td>Error</td></tr>
</tbody></table>
<section><h2>Configuration</h2><pre><code>[*.cs]
dotnet_diagnostic.RT0001.severity = error
dotnet_diagnostic.LVP0003.severity = warning
</code></pre><p>For the complete diagnostic contract, triggering conditions, compatibility rules, and message semantics, read <a href="https://github.com/mao2009/PureSharp/blob/main/docs/DIAGNOSTICS.md">docs/DIAGNOSTICS.md</a>.</p></section>
</main><footer><p><a href="https://github.com/mao2009/PureSharp">PureSharp on GitHub</a>.</p></footer></body></html>
16 changes: 16 additions & 0 deletions docs/features.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>PureSharp Features | C# Purity, Immutability, and FluentIf</title>
<meta name="description" content="Explore PureSharp features for C#: PureMethod referential-transparency checks, immutable local-variable conventions, FluentIf validation, and Roslyn analyzer integration.">
<link rel="canonical" href="https://mao2009.github.io/PureSharp/features.html"><link rel="stylesheet" href="assets/site.css">
</head>
<body><header><nav><a class="brand" href="./">PureSharp</a><span><a href="features.html">Features</a><a href="diagnostics.html">Diagnostics</a><a href="https://github.com/mao2009/PureSharp">GitHub</a></span></nav></header>
<main><h1>PureSharp features</h1>
<section><h2>PureMethod checks</h2><p>Annotate methods with <code>[PureMethod]</code> 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.</p></section>
<section><h2>Immutable local variables</h2><p>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.</p></section>
<section><h2>FluentIf</h2><p><code>Fluent.If</code> provides expression-oriented conditional flow. The analyzer verifies that a chain is terminated with <code>.Else(...)</code>, preventing incomplete fluent conditions from becoming unnoticed logic errors.</p></section>
<section><h2>Roslyn-native workflow</h2><p>PureSharp diagnostics appear during normal IDE analysis and <code>dotnet build</code>. Severity can be configured with standard <code>dotnet_diagnostic.&lt;ID&gt;.severity</code> settings in <code>.editorconfig</code>.</p></section>
<section><h2>Project components</h2><ul><li><strong>PureSharp.Core</strong> — attributes and runtime utilities.</li><li><strong>PureSharp.Analyzers</strong> — compile-time Roslyn diagnostics.</li><li><strong>PureSharp.Analyzers.Tests</strong> — analyzer behavior tests.</li></ul></section>
</main><footer><p><a href="https://github.com/mao2009/PureSharp">Source code and contribution history on GitHub</a>.</p></footer></body></html>
21 changes: 21 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PureSharp | C# Roslyn Analyzer for Referential Transparency and Immutability</title>
<meta name="description" content="PureSharp is an open-source C# Roslyn analyzer and library for referential transparency, immutable local variables, and safer functional-style control flow.">
<link rel="canonical" href="https://mao2009.github.io/PureSharp/">
<link rel="stylesheet" href="assets/site.css">
</head>
<body>
<header><nav><a class="brand" href="./">PureSharp</a><span><a href="features.html">Features</a><a href="diagnostics.html">Diagnostics</a><a href="https://github.com/mao2009/PureSharp">GitHub</a></span></nav></header>
<main>
<section class="hero"><p class="eyebrow">Functional programming support for C#</p><h1>PureSharp</h1><p class="lead">A Roslyn-based toolset that brings compile-time checks for referential transparency, local-variable immutability, and safer functional-style control flow to C#.</p><p>PureSharp helps developers make purity and immutability explicit and mechanically verifiable instead of relying only on conventions and code review.</p><p><a class="button" href="https://www.nuget.org/packages/loach.PureSharp">Get PureSharp on NuGet</a> <a class="button secondary" href="https://github.com/mao2009/PureSharp">View on GitHub</a></p></section>
<section><h2>What PureSharp checks</h2><div class="grid"><article><h3>Referential transparency</h3><p>Methods marked with <code>[PureMethod]</code> are checked for mutable static state, non-pure calls, and I/O operations.</p></article><article><h3>Immutable local variables</h3><p>Locals using PureSharp's underscore convention can be required to initialize once and never be reassigned.</p></article><article><h3>Fluent conditional flow</h3><p><code>Fluent.If</code> chains are checked so incomplete conditional expressions do not silently escape validation.</p></article></div></section>
<section><h2>Why use it?</h2><p>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.</p></section>
<section><h2>Open source and configurable</h2><p>Diagnostics use standard <code>.editorconfig</code> severity controls. PureSharp is MIT licensed and its analyzer behavior is documented in a versioned diagnostic contract.</p></section>
</main>
<footer><p>PureSharp is an independent open-source C# project.</p></footer>
</body>
</html>
4 changes: 4 additions & 0 deletions docs/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://mao2009.github.io/PureSharp/sitemap.xml
6 changes: 6 additions & 0 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://mao2009.github.io/PureSharp/</loc></url>
<url><loc>https://mao2009.github.io/PureSharp/features.html</loc></url>
<url><loc>https://mao2009.github.io/PureSharp/diagnostics.html</loc></url>
</urlset>
Loading