Fix clang-format configuration
The configuration was only including files that were in a commit diff.
This causes issues where we generate sources during the PRESUBMIT (which
are not in the git diff at that point in time) and don't format.
At the same time, we remove the complicated logic to reuse the
`.eslintignore` for clang-format purposes and use the correct
`.clang-format` "DisableFormat" options to disable formatting in various
directories.
Roll CodeMirror: ignore
Change-Id: I21b95a6e09c5d6bf036bf1aace103d6c26823ecc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091445
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 58b1101..f9b734a 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -116,29 +116,7 @@
def popen(args):
return input_api.subprocess.Popen(args=args, stdout=input_api.subprocess.PIPE, stderr=input_api.subprocess.STDOUT)
- affected_files = _getAffectedJSFiles(input_api)
- if len(affected_files) == 0:
- return results
- original_sys_path = sys.path
- try:
- sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), 'scripts')]
- import devtools_paths
- finally:
- sys.path = original_sys_path
-
- ignore_files = []
- eslint_ignore_path = input_api.os_path.join(input_api.PresubmitLocalPath(), '.eslintignore')
- with open(eslint_ignore_path, 'r') as ignore_manifest:
- for line in ignore_manifest:
- if '*' not in line.strip():
- ignore_files.append(input_api.os_path.normpath(line.strip()))
- formattable_files = [
- affected_file for affected_file in affected_files if all(ignore_file not in affected_file for ignore_file in ignore_files)
- ]
- if len(formattable_files) == 0:
- return results
-
- format_args = ['git', 'cl', 'format', '--js'] + formattable_files
+ format_args = ['git', 'cl', 'format', '--js']
format_process = popen(format_args)
format_out, _ = format_process.communicate()
if format_process.returncode != 0: