Run the linter before the formatter
This makes sure that if the linter makes changes, we also format them.
This removes the need for running eslint twice, which is wasteful.
Change-Id: I4362c2c039af51a5a72cac3fce02351165a5bb66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2000785
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index dd67018..7ea91de 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -135,15 +135,6 @@
if format_process.returncode != 0:
return [output_api.PresubmitError(format_out)]
- # Use eslint to autofix the braces.
- # Also fix semicolon to avoid confusing clang-format.
- eslint_process = popen(
- [devtools_paths.node_path(), devtools_paths.eslint_path(), '--config', '.eslintrc.js', '--fix'] + affected_files)
- eslint_process.communicate()
-
- # Need to run clang-format again to align the braces
- popen(format_args).communicate()
-
return [
output_api.PresubmitError('ERROR: Found formatting violations.\n'
'Ran clang-format on diff\n'
@@ -241,8 +232,8 @@
results.extend(input_api.canned_checks.CheckGenderNeutral(input_api, output_api))
results.extend(_CheckBuildGN(input_api, output_api))
results.extend(_CheckJSON(input_api, output_api))
- results.extend(_CheckFormat(input_api, output_api))
results.extend(_CheckDevtoolsStyle(input_api, output_api))
+ results.extend(_CheckFormat(input_api, output_api))
results.extend(_CheckOptimizeSVGHashes(input_api, output_api))
results.extend(_CheckCSSViolations(input_api, output_api))
results.extend(_CheckChangesAreExclusiveToDirectory(input_api, output_api))