Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: third_party/closure_linter/closure_linter/fixjsstyle.py

Issue 2328693002: Updated linter with upstream release (2.3.19) (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/closure_linter/closure_linter/fixjsstyle.py
diff --git a/third_party/closure_linter/closure_linter/fixjsstyle.py b/third_party/closure_linter/closure_linter/fixjsstyle.py
index 1b5905b131c7e57b42666224c63c222d6ae0f7f4..2d65e0398fdcc6d2df189bb89bdd1f22af180056 100755
--- a/third_party/closure_linter/closure_linter/fixjsstyle.py
+++ b/third_party/closure_linter/closure_linter/fixjsstyle.py
@@ -18,6 +18,7 @@
__author__ = 'robbyw@google.com (Robert Walker)'
+import StringIO
Dan Beam 2016/09/08 21:39:07 this is probably fine
import sys
import gflags as flags
@@ -30,6 +31,7 @@ FLAGS = flags.FLAGS
flags.DEFINE_list('additional_extensions', None, 'List of additional file '
'extensions (not js) that should be treated as '
'JavaScript files.')
+flags.DEFINE_boolean('dry_run', False, 'Do not modify the file, only print it.')
def main(argv=None):
@@ -47,11 +49,17 @@ def main(argv=None):
files = fileflags.GetFileList(argv, 'JavaScript', suffixes)
- fixer = error_fixer.ErrorFixer()
+ output_buffer = None
+ if FLAGS.dry_run:
+ output_buffer = StringIO.StringIO()
+
+ fixer = error_fixer.ErrorFixer(output_buffer)
# Check the list of files.
for filename in files:
runner.Run(filename, fixer)
+ if FLAGS.dry_run:
+ print output_buffer.getvalue()
if __name__ == '__main__':
« no previous file with comments | « third_party/closure_linter/closure_linter/errors.py ('k') | third_party/closure_linter/closure_linter/fixjsstyle_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698