feat: add excludePatterns parameter to violation reporting tools#25
Merged
Karnaukhov-kh merged 5 commits intopush-based:mainfrom Mar 17, 2026
Conversation
Add optional excludePatterns parameter to report-violations and report-all-violations tools, enabling users to exclude files/directories from violation scans using glob patterns. Features: - Supports single string or array of glob patterns - Standard glob syntax: *, **, ?, character classes - Custom glob-to-regex converter (no external dependencies) - Post-processing filter approach (filters after plugin execution) - Cross-platform path normalization - Fail-fast validation with clear error messages Changes: - Add excludePatterns to schema definitions (schema-helpers.ts) - Update type interfaces across all layers - Implement inline pattern matching in coverage-analyzer.ts - Pass excludePatterns through base-analyzer.ts - Update both tool handlers to accept and forward parameter Examples: - Single: excludePatterns: 'node_modules/**' - Multiple: excludePatterns: ['node_modules/**', '**/dist/**', '**/*.spec.ts'] Fixes path handling bug: Use issue.source.file directly (already relative) instead of calling path.relative() Build: Passes successfully without errors Backward Compatible: Optional parameter, no breaking changes
Member
|
Hi @AbdulRehaman08, thank you for this PR. When you have time, please check pipeline failure (should be simple format write run). When you're ready, put it as "Ready for review". |
There was a problem hiding this comment.
Pull request overview
Adds an optional excludePatterns parameter to the DS violation reporting tools so users can exclude matching files/directories from violation results using glob-like patterns.
Changes:
- Extends schemas and option/type interfaces to accept
excludePatternsasstring | string[]. - Threads
excludePatternsthrough analyzers and tool handlers. - Implements post-processing filtering of plugin issues in
coverage-analyzer.tsbased on glob matching.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/types.ts | Adds excludePatterns to shared analyzer params/options types. |
| packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts | Adds glob-to-regex conversion + issue filtering to exclude matched paths. |
| packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/base-analyzer.ts | Passes excludePatterns through to coverage analysis. |
| packages/angular-mcp-server/src/lib/tools/ds/shared/models/schema-helpers.ts | Adds excludePatterns schema property and injects it into common schemas. |
| packages/angular-mcp-server/src/lib/tools/ds/report-violations/report-violations.tool.ts | Forwards excludePatterns into the base analyzer call. |
| packages/angular-mcp-server/src/lib/tools/ds/report-violations/report-all-violations.tool.ts | Forwards excludePatterns into project coverage analysis call. |
| packages/angular-mcp-server/src/lib/tools/ds/report-violations/models/types.ts | Adds excludePatterns to tool option types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
packages/angular-mcp-server/src/lib/tools/ds/shared/models/schema-helpers.ts
Outdated
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts
Outdated
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts
Outdated
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/shared/violation-analysis/coverage-analyzer.ts
Show resolved
Hide resolved
packages/angular-mcp-server/src/lib/tools/ds/report-violations/report-violations.tool.ts
Show resolved
Hide resolved
added 2 commits
March 16, 2026 17:44
…ation, score fix, schema cleanup
Karnaukhov-kh
approved these changes
Mar 17, 2026
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.
Add optional
excludePatternsparameter toreport-violationsandreport-all-violationstools, enabling users to exclude files/directories from violation scans using glob patterns.Features:
*,**,?normalizeFilePathfor consistent path handlingscore: 1Changes:
excludePatternsto schema definitions (schema-helpers.ts)coverage-analyzer.tsusingnormalizeFilePathfromformatters.tsexcludePatternsthroughbase-analyzer.tsvia spread ({ ...options, cwd, ... })Examples:
excludePatterns: "node_modules/**"excludePatterns: ["node_modules/**", "**/dist/**", "**/*.spec.ts"]Build: Passes successfully without errors
Backward Compatible: Optional parameter, no breaking changes