Add no-dayc suppression comments#67
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a suppression mechanism for DAYamlChecker findings, allowing users to silence specific findings via # no-dayc / # no-dayc-block comments in YAML and via a new --suppress CLI flag.
Changes:
- Added parsing and application of inline (
# no-dayc: ...) and document-level (# no-dayc-block: ...) suppressions. - Added
--suppressCLI argument to globally suppress findings by code or class. - Updated README and added tests for inline and block suppressions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_yaml_structure.py | Adds test cases for inline and document-level suppression behavior. |
| src/dayamlchecker/yaml_structure.py | Implements suppression parsing/matching and wires it into string/file processing and CLI. |
| README.md | Documents the new suppression syntax and CLI option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
additional commits to address the latest feedback:
|
rajeswari1301
left a comment
There was a problem hiding this comment.
Looks good to me! Tested and works exactly as the README says and all the new tests pass.
One question, I want to understand if the inline # no-dayc comment get applied based on the finding's line or the line the comment itself is on? those aren't always the same when there are multiple code blocks.
Inline ignore comments apply to the line that the comment appears on, which means you can't use it on all block types |
Summary
Implemented
# no-daycfinding suppression functionality (fixes #52).Changes
# no-dayc: <codes>and# no-dayc-block: <codes>parsing in
yaml_structure.pyto allow suppressing specific findings within the YAML source.--suppresscommand-line argument that accepts a comma-separated list of IDs or finding classes, suppressing them globally across all checked files.
classes (e.g.
accessibility,style) in addition to precise IDs.README.mdwith comprehensive instructions and examples on how to utilizethese new suppression features.
test_yaml_structure.pycovering inline and block suppressions and ensuringfindings do not bleed across blocks.