Support Suppressions for file types without comments
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 1k
- Forks
- 131
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
Is your feature request related to a problem? Please describe.
Some file types (in particular JSON) do not support comments and so it is not feasible to include suppressions directly in the files.
Describe the solution you'd like
A mechanism to specify suppressions for those files using an additional file. This can either be a new suppressions file either globally for the project or for each file or additional options either via options-json or via a second suppressions-json argument.
Additional Context
One possible implementation is with a json ignore format like this, which could either be added to options-json or as a separate suppressions-json argument.
{
"ignore": [
{
"path": "relative/path/to/file.json",
"issue_id": ["DS173237"],
"description": "This ignores all the issues DS173237 in the file relative/path/to/file.json"
},
{
"path": "relative/path/to/some/other/file.cc",
"line": 10,
"issue_id": ["DS173237"],
"description": "This ignores all the issues DS173237 in the file relative/path/to/some/other/file.cc at line 10"
},
{
"path": "relative/path/dir",
"issue_id": ["DS173237"],
"description": "This ignores all the issues DS173237 in the directory relative/path/dir"
}
]
}
Additional considerations
When running the suppress command it would be nice (but is not essential for this) to be able to either generate the new entries to be added to this config file or to directly update it. To detect if issues are already suppressed, the suppression file should also be an argument to the suppress command.
Primary implementation would be in the CLI, but ideally can add an option for the IDE to specify a suppressions file. If the IDE is configured to use a suppressions file, perhaps new suppressions should be written into it, or have an option to put new suppressions into it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the CLI suppress command and the options-json or suppressions-json configuration paths described in the issue. Then inspect how IDE configuration is handled. Done means agreeing on a suppression-file format and supporting file- and line-based suppressions for comment-free files, with suppress-command integration considered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, security, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100