(no title)
gorgoiler | 27 days ago
The more trad technique for this would be to mark the offending line with # noqa or # ignore: foo. Another way is to have a .fooignore file but those are usually for paths or path globs to ignore.
I like the author’s idea[1] of having the “ignore” mechanism next to the linter codebase itself, rather than mixed in with the production codebase. Adding the files and line numbers for known-offenders to that code could be a useful alternative to a simple sum?
Perhaps more robustly, some kind of XPath like AST syntax to indicate which parts of the codebase have the known problem? It feels just as fragile and could quickly get over complicated.
At the end of the day an online comment has always done it for me. With Python, Meta’s libcst is an excellent and fast way to get an AST that includes comments. It’s the most robust tool I’ve found but you can just use built-in ast.py and ad-hoc file:line parsing too.
https://github.com/Instagram/LibCST
[1] Sorry to be a fanboi but Antimemetics is amazing!
Normal_gaussian|27 days ago
I ended up using something similar to `// @ts-ignore` which would encode a truncated hash of the error message on the line, as well as a truncated hash of the lines AST; the original error message and the justification.
These were long lines so were a PITA, but they immediately had this 'ratchet' effect.
I tried several times to move to a central file referencing the issues, but the complexity in maintaining the references with common refactors was a blocker.