Disable Reporting of Specific Errors

102 views
Skip to first unread message

Eric Siroker

unread,
Sep 1, 2010, 7:11:00 PM9/1/10
to Closure Linter Discuss
As far as I can tell, --[no]jsdoc is currently the only command flag
that influences which errors are reported. It looks like the
observance of that flag occurs in ShouldReportError() from
closure_linter/errorrules.py.

Could a flag be added that let one specify on a more granular level
which errors to disable (possibly by error code)? I'd like to use
gjslint with a large existing codebase, but unfortunately our coding
standards differ slightly from the ones gjslint enforce. It would be
nice if I could just disable the reporting of errors that occur as a
result of the disparity between our standards.

If this feature is deemed worthwhile, but not a high priority for the
Linter team, I could take a crack at implementing it. I'd prefer it
if you guys implemented it yourselves though :)

Thanks for releasing another great tool in the Closure suite!

Eric

Andy Perelson

unread,
Sep 3, 2010, 8:13:16 PM9/3/10
to closure-lin...@googlegroups.com
Eric,

In addition to --[no]jsdoc there is the less severe --limited_doc_files=<comma separated list of files> which for the specified files has fewer jsdoc checks. Additionally there is a jsdoc annotation that can be used to suppress some errors in a similar syntax to the Closure Compiler, e.g.,

foo.bar = function() {
  /** @suppress {with} */
  with ({}) {}
};

Not many things are suppressible today. The only 3 valid options are with, duplicate (suppress warnings about duplicate declarations), and underscore (warnings around bad using of _ in names as methods have migrated from private to protected or public. That said, we have intentionally avoided adding the ability to suppress most errors. We want people internally to follow the style guide, not ignore it. That said, we cannot expect everyone in the world to perfectly follow our style guide and it'd be nice if they could still get something out of the Closure Linter. So as you might have suspected, it is something we would like to have available to you, but it's definitely not our highest priority to implement.

For features that you would like us to implement feel free to file issues against us at http://code.google.com/p/closure-linter/issues/list. I don't guarantee that we'll get to all of them immediately, but then at least we can track what people would like, and eventually we will hopefully open the linter up to accepting patches from the community making it easier to make contributions.

Thank you,

Andy
Reply all
Reply to author
Forward
0 new messages