Skip to content

Add wildcard exclude patterns for DotNet namespaces/types - #34

Merged
Malcolmnixon merged 4 commits into
mainfrom
copilot/add-filter-dotnet-namespaces
Jul 4, 2026
Merged

Add wildcard exclude patterns for DotNet namespaces/types#34
Malcolmnixon merged 4 commits into
mainfrom
copilot/add-filter-dotnet-namespaces

Conversation

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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)

  • Added DotNetGeneratorOptions.ExcludePatterns: a list of *-wildcard patterns matched against a type's full namespace-qualified name or containing namespace
  • Applied during the existing visibility/obsolete/compiler-generated filter pass in DotNetGenerator, so excluded types are removed before namespace grouping — they never surface in indexes, namespace summaries, or type pages

CLI (ApiMark.Tool)

  • Added repeatable --exclude <pattern> option, consistent with existing repeatable flags like --includes

MSBuild (ApiMark.MSBuild)

  • Added ApiMarkExclude property (semicolon-separated patterns), following the same convention as ApiMarkIncludePaths
  • Wired through the .targets file and ApiMarkTask.BuildArguments into repeated --exclude CLI flags

Example

<PropertyGroup>
  <ApiMarkExclude>Antlr4.*;MyProject.Generated.*</ApiMarkExclude>
</PropertyGroup>
apimark dotnet --assembly MyLib.dll --xml-doc MyLib.xml --exclude "Antlr4.*" --exclude "MyProject.Generated.*"

Documentation (design docs, user guide) and unit tests covering the filtering logic, CLI parsing, and MSBuild argument generation were updated alongside the implementation.

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
Copilot AI requested a review from Malcolmnixon July 3, 2026 23:20
@Malcolmnixon
Malcolmnixon marked this pull request as ready for review July 3, 2026 23:33
Copilot AI review requested due to automatic review settings July 3, 2026 23:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ExcludePatterns and applied exclude filtering during the existing type-filter pass (before namespace grouping).
  • Added repeatable CLI flag --exclude <pattern> and plumbed it through ContextProgramDotNetGeneratorOptions.
  • Added MSBuild property ApiMarkExclude (semicolon-delimited) and forwarded it as repeated --exclude arguments.

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.

Comment thread src/ApiMark.DotNet/DotNetGenerator.cs Outdated
Comment thread test/ApiMark.DotNet.Tests/DotNetGeneratorTests.cs
Comment thread docs/reqstream/api-mark-core/file-markdown-writer.yaml Outdated
@Malcolmnixon
Malcolmnixon merged commit 610b363 into main Jul 4, 2026
15 checks passed
@Malcolmnixon
Malcolmnixon deleted the copilot/add-filter-dotnet-namespaces branch July 4, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need the ability to filter DotNet namespaces from ApiMark documentation

3 participants