maid-validator-csharp
A C# (.cs) language validator plugin for
MAID Runner, backed by
tree-sitter-c-sharp.
It registers through MAID Runner's maid_runner.validators entry point, so once
installed alongside maid-runner, maid validate / maid snapshot /
maid bootstrap handle .cs files with no core changes. This follows MAID
Runner's validator plugin authoring
support boundary: new languages ship as external packages.
Install
pip install maid-validator-csharp
# or, for local development against a checked-out maid-runner:
uv pip install -e ../maid-runner -e .
Confirm it is active:
maid validators
# CSharpValidator .cs maid-validator-csharp <ver> active
What it collects
C# constructs are mapped onto MAID's language-neutral artifact kinds:
| C# construct | MAID kind |
Notes |
|---|---|---|
namespace (block and file-scoped) |
namespace |
|
class, struct, record, record struct |
class |
bases = base type + implemented interfaces |
interface |
interface |
members are implicitly public |
enum |
enum |
|
delegate |
type |
records args + return type |
| method / constructor | method |
of = declaring type; captures args (name/type/default), returns, generic type_parameters, async |
| property / field | attribute |
of = declaring type; captures the declared type |
| top-level local function | function |
Only the public API surface is emitted — public/protected members and
public types, interface members, and top-level local functions.
private/internal/implicitly-private members are dropped, and
leading-underscore names are treated as private (excluded from snapshots).
Behavioral collection (from test files) emits test_function markers for
xUnit/NUnit/MSTest methods ([Fact], [Theory], [Test], [TestMethod], …)
and identity references for the types (new Widget()) and methods
(Calc.Add(...), Render(...)) those tests exercise.
Development
uv sync # or: uv pip install -e '.[dev]'
uv run pytest -v # runs the MAID conformance kit + hand-written suites
uv run ruff check src/ tests/
uv run black --check src/ tests/
The MAID conformance kit
(tests/test_conformance.py) is the acceptance bar: it proves the collector
cannot manufacture false-green validation for C#.
See CHANGELOG.md for release history and RELEASING.md for the trusted-publishing procedure.
Known limitations
- Method overloads collapse on MAID's
method:Type.Nameidentity key, so overloaded methods can't be distinguished individually. Declare one representative, or leaveargsunspecified in the manifest. - Type normalization: MAID Runner's type comparison is Python-type-centric;
C# generics/nullable (
List<T>,Task<T>,int?) are recorded verbatim and are not normalized. Keep manifesttype/returnsunspecified (matches anything) or byte-exact. - Module identity: C# module identity is the in-file
namespace, not a path-derived module, so cross-fileusing/namespace resolution is not yet performed; behavioral matching binds on kind/name/parent. - Partial classes are collected per file; cross-file merging is MAID Runner's responsibility via manifest chains.
- Parser fidelity is bounded by the tree-sitter-c-sharp grammar. Unparseable or
unsupported syntax yields a
CollectionResultwitherrorsand no artifacts (never a crash).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maid_validator_csharp-0.1.0.tar.gz.
File metadata
- Download URL: maid_validator_csharp-0.1.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95fbdf40cbb59f510848b21bf4ee3e3151c116b7c982e628ae7b8fc64a8695d8
|
|
| MD5 |
c5e0aecd2dc40132a792a23498373c99
|
|
| BLAKE2b-256 |
455c190173f44d062bb0336678e7e6b24f3587e53c329a4ff5136a05e3ec4169
|
Provenance
The following attestation bundles were made for maid_validator_csharp-0.1.0.tar.gz:
Publisher:
publish.yml on mamertofabian/maid-validator-csharp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maid_validator_csharp-0.1.0.tar.gz -
Subject digest:
95fbdf40cbb59f510848b21bf4ee3e3151c116b7c982e628ae7b8fc64a8695d8 - Sigstore transparency entry: 2310258237
- Sigstore integration time:
-
Permalink:
mamertofabian/maid-validator-csharp@4526e62a4af04feef9d0fb31c6702528f1968ca5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mamertofabian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4526e62a4af04feef9d0fb31c6702528f1968ca5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file maid_validator_csharp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maid_validator_csharp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
254995bd1e29d81704962fd0530b50d2857be8a7ea4963f0d9491b3048360732
|
|
| MD5 |
f9b96f927e3624a906ee5812e836f228
|
|
| BLAKE2b-256 |
b63691863cc8e6994d0001bb9d400ea09e58a7f49a0ac94578a22b74350619a5
|
Provenance
The following attestation bundles were made for maid_validator_csharp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mamertofabian/maid-validator-csharp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maid_validator_csharp-0.1.0-py3-none-any.whl -
Subject digest:
254995bd1e29d81704962fd0530b50d2857be8a7ea4963f0d9491b3048360732 - Sigstore transparency entry: 2310258244
- Sigstore integration time:
-
Permalink:
mamertofabian/maid-validator-csharp@4526e62a4af04feef9d0fb31c6702528f1968ca5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mamertofabian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4526e62a4af04feef9d0fb31c6702528f1968ca5 -
Trigger Event:
push
-
Statement type: