Add //lint:ignore <category> directive to Cadence linter#2330
Add //lint:ignore <category> directive to Cadence linter#2330
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
366804f to
6dd366a
Compare
6dd366a to
9f7388f
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Great idea @holyfuchs ! Couple questions: Would it be possible to make this a PR to the https://github.com/onflow/cadence-tools repo instead? Ideally we would preserve this abstraction layer, and not require the CLI to independently parse the source code. I.e. the linter is used internally by the Cadence Language Server & Flow MCP Server as well, so ideally this sort of feature lands in all the places it would apply to. Second, I'm not really sure, but curious what you think - unlike other general purpose languages, the source code of a smart contract language is intended to be readable by users. Are there any concerns that an inline flag could encourage users to pollute their production contracts/transactions with development artifacts? I'm assuming that a config file/CLI flags would not solve your use case? |
Description
Adds inline suppression directives to the Cadence linter. Place
//lint:ignore <category>on the same line or the line immediately before a diagnostic to suppress it. A new--show-ignoredflag reveals what is being suppressed.How it works
The category must match the diagnostic category exactly (e.g.
semantic-error,removal-hint,replacement-hint,security).Ignored diagnostics are counted in the summary but never affect the exit code: