Add wildcard exclude patterns for DotNet namespaces/types - #34
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add ability to filter DotNet namespaces from ApiMark documentation
Add wildcard exclude patterns for DotNet namespaces/types
Jul 3, 2026
Malcolmnixon
marked this pull request as ready for review
July 3, 2026 23:33
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for excluding .NET namespaces/types from generated ApiMark output using *-wildcard patterns, surfaced consistently through the core generator, CLI, and MSBuild integration to keep generated/third-party code (e.g., ANTLR output) out of documentation.
Changes:
- Added
DotNetGeneratorOptions.ExcludePatternsand applied exclude filtering during the existing type-filter pass (before namespace grouping). - Added repeatable CLI flag
--exclude <pattern>and plumbed it throughContext→Program→DotNetGeneratorOptions. - Added MSBuild property
ApiMarkExclude(semicolon-delimited) and forwarded it as repeated--excludearguments.
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/ApiMark.Tool.Tests/ProgramTests.cs | Integration test for --exclude affecting emitted files |
| test/ApiMark.Tool.Tests/Cli/ContextTests.cs | Unit tests for parsing --exclude into Context.Excludes |
| test/ApiMark.MSBuild.Tests/ApiMarkTaskTests.cs | Unit test for MSBuild exclude → repeated --exclude args |
| test/ApiMark.DotNet.Tests/DotNetGeneratorTests.cs | Unit tests for exclude filtering behavior in DotNet generator |
| test/ApiMark.DotNet.Fixtures/ExcludedSample.cs | Fixture type/namespace used by exclude filtering tests |
| src/ApiMark.Tool/Program.cs | Wires Context.Excludes into DotNetGeneratorOptions.ExcludePatterns and updates help |
| src/ApiMark.Tool/Cli/Context.cs | Adds Excludes to CLI context and parses repeatable --exclude |
| src/ApiMark.MSBuild/build/DemaConsulting.ApiMark.MSBuild.targets | Passes $(ApiMarkExclude) into ApiMark task |
| src/ApiMark.MSBuild/ApiMarkTask.cs | Adds ApiMarkExclude and forwards as repeated --exclude flags |
| src/ApiMark.DotNet/DotNetGenerator.cs | Implements wildcard exclude compilation + filtering in Parse pipeline |
| docs/verification/api-mark-tool/program.md | Verification checklist updated for --exclude |
| docs/verification/api-mark-tool/cli/context.md | Verification checklist updated for Context.Excludes parsing |
| docs/verification/api-mark-msbuild/api-mark-task.md | Verification checklist updated for MSBuild exclude forwarding |
| docs/verification/api-mark-dot-net/dot-net-generator.md | Verification checklist updated for exclude filtering behavior |
| docs/user_guide/dotnet.md | User guide documents --exclude and MSBuild ApiMarkExclude |
| docs/reqstream/ots/file-system-globbing.yaml | ReqStream formatting update (list normalization) |
| docs/reqstream/ots/dema-consulting-test-results.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-vhdl/vhdl-generator.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-vhdl/vhdl-emitter.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-vhdl/vhdl-emitter-gradual-disclosure.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-vhdl/vhdl-ast-parser.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-tool/program.yaml | ReqStream requirements updated for --exclude support + test mapping |
| docs/reqstream/api-mark-tool/cli/context.yaml | ReqStream requirements updated for parsing --exclude |
| docs/reqstream/api-mark-tool/cli.yaml | ReqStream formatting update (tests list normalization) |
| docs/reqstream/api-mark-msbuild/api-mark-task.yaml | ReqStream requirements updated for ApiMarkExclude forwarding |
| docs/reqstream/api-mark-dot-net/xml-doc-reader.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-dot-net/type-name-simplifier.yaml | ReqStream formatting (tests list style) |
| docs/reqstream/api-mark-dot-net/type-link-resolver.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-dot-net/dot-net-generator.yaml | ReqStream requirements updated for exclude-pattern filtering + test mapping |
| docs/reqstream/api-mark-dot-net/dot-net-emitter.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-dot-net/dot-net-emitter-single-file.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-dot-net/dot-net-emitter-gradual-disclosure.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-cpp/cpp-type-link-resolver.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-cpp/cpp-generator.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-cpp/cpp-emitter.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-cpp/cpp-emitter-single-file.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-cpp/cpp-emitter-gradual-disclosure.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-cpp/cpp-ast-model.yaml | ReqStream formatting update (tests list normalization) |
| docs/reqstream/api-mark-cpp/clang-ast-parser.yaml | ReqStream formatting update (tests list normalization) |
| docs/reqstream/api-mark-cpp.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-core/path-helpers.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-core/i-markdown-writer.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-core/i-context.yaml | ReqStream formatting update (tests list normalization) |
| docs/reqstream/api-mark-core/i-api-generator.yaml | ReqStream formatting/wrapping updates |
| docs/reqstream/api-mark-core/file-markdown-writer.yaml | ReqStream formatting update (includes a small text typo) |
| docs/reqstream/api-mark-core/file-markdown-writer-factory.yaml | ReqStream formatting/wrapping updates |
| docs/design/api-mark-msbuild/api-mark-task.md | Design doc updated for ApiMarkExclude behavior |
| docs/design/api-mark-msbuild.md | Design doc updated to list new MSBuild property |
| docs/design/api-mark-dot-net/dot-net-generator.md | Design doc updated for exclude filtering algorithm |
| docs/design/api-mark-dot-net.md | Design doc updated for new option in data flow and constraints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tools like Antlr generate large amounts of public code that gets picked up by ApiMark and pollutes generated documentation. There was no way to exclude specific namespaces or types from the CLI or MSBuild pipelines.
Core generator (
ApiMark.DotNet)DotNetGeneratorOptions.ExcludePatterns: a list of*-wildcard patterns matched against a type's full namespace-qualified name or containing namespaceDotNetGenerator, so excluded types are removed before namespace grouping — they never surface in indexes, namespace summaries, or type pagesCLI (
ApiMark.Tool)--exclude <pattern>option, consistent with existing repeatable flags like--includesMSBuild (
ApiMark.MSBuild)ApiMarkExcludeproperty (semicolon-separated patterns), following the same convention asApiMarkIncludePaths.targetsfile andApiMarkTask.BuildArgumentsinto repeated--excludeCLI flagsExample
Documentation (design docs, user guide) and unit tests covering the filtering logic, CLI parsing, and MSBuild argument generation were updated alongside the implementation.