Skip to content

Instantly share code, notes, and snippets.

@guileen
Created December 7, 2011 07:30
Show Gist options
  • Save guileen/1441870 to your computer and use it in GitHub Desktop.
Save guileen/1441870 to your computer and use it in GitHub Desktop.
closure lint ignore error
Index: errorrules.py
===================================================================
--- errorrules.py (revision 7)
+++ errorrules.py (working copy)
@@ -25,6 +25,7 @@
FLAGS = flags.FLAGS
flags.DEFINE_boolean('jsdoc', True,
'Whether to report errors for missing JsDoc.')
+flags.DEFINE_list('ignore_errors', [], 'List of error codes to ignore.')
def ShouldReportError(error):
@@ -34,9 +35,9 @@
True for all errors except missing documentation errors. For these,
it returns the value of the jsdoc flag.
"""
- return FLAGS.jsdoc or error not in (
+ return (FLAGS.jsdoc or error not in (
errors.MISSING_PARAMETER_DOCUMENTATION,
errors.MISSING_RETURN_DOCUMENTATION,
errors.MISSING_MEMBER_DOCUMENTATION,
errors.MISSING_PRIVATE,
- errors.MISSING_JSDOC_TAG_THIS)
+ errors.MISSING_JSDOC_TAG_THIS)) and str(error) not in FLAGS.ignore_errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment