Merge pull request #821 from tschaub/generated-file-linting
Create separate target for linting generated files
This commit is contained in:
21
build.py
21
build.py
@@ -346,19 +346,32 @@ def serve_precommit(t):
|
|||||||
'buildcfg/ol-all.json', 'buildcfg/test.json')
|
'buildcfg/ol-all.json', 'buildcfg/test.json')
|
||||||
|
|
||||||
|
|
||||||
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
|
virtual('lint', 'build/lint-timestamp', 'build/lint-generated-timestamp',
|
||||||
'build/check-whitespace-timestamp')
|
'build/check-requires-timestamp', 'build/check-whitespace-timestamp')
|
||||||
|
|
||||||
|
|
||||||
@target('build/lint-timestamp', SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC,
|
@target('build/lint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
|
||||||
SPEC, precious=True)
|
|
||||||
def build_lint_src_timestamp(t):
|
def build_lint_src_timestamp(t):
|
||||||
|
t.run('%(GJSLINT)s',
|
||||||
|
'--jslint_error=all',
|
||||||
|
'--strict',
|
||||||
|
t.newer(t.dependencies))
|
||||||
|
t.touch()
|
||||||
|
|
||||||
|
|
||||||
|
@target('build/lint-generated-timestamp', INTERNAL_SRC, EXTERNAL_SRC,
|
||||||
|
precious=True)
|
||||||
|
def build_lint_generated_timestamp(t):
|
||||||
limited_doc_files = [
|
limited_doc_files = [
|
||||||
path
|
path
|
||||||
for path in ifind('externs', 'build/src/external/externs')
|
for path in ifind('externs', 'build/src/external/externs')
|
||||||
if path.endswith('.js')]
|
if path.endswith('.js')]
|
||||||
t.run('%(GJSLINT)s',
|
t.run('%(GJSLINT)s',
|
||||||
'--jslint_error=all',
|
'--jslint_error=all',
|
||||||
|
# ignore error for max line length (for these auto-generated sources)
|
||||||
|
'--disable=110',
|
||||||
|
# for a complete list of error codes to allow, see
|
||||||
|
# http://closure-linter.googlecode.com/svn/trunk/closure_linter/errors.py
|
||||||
'--limited_doc_files=%s' % (','.join(limited_doc_files),),
|
'--limited_doc_files=%s' % (','.join(limited_doc_files),),
|
||||||
'--strict',
|
'--strict',
|
||||||
t.newer(t.dependencies))
|
t.newer(t.dependencies))
|
||||||
|
|||||||
Reference in New Issue
Block a user