PRESUBMIT.py: Add formatting checks.
GN files are checked using the canned presubmit check but we cannot do
the same for C/C++ files: the canned check uses git cl format which can
only use clang-format 5.0 and requires formatting of all the source
code.
Instead we write our own clang-format check, reusing the script that
checks formatting on Travis. To have a recent version of clang-format we
import one from a helper repo.
This also fix a formatting error in .gn and adds licenses to the
clang-format linting scripts.
Change-Id: I4d8208472a8a6bd32ae3ef41c3145abf270a4c37
diff --git a/DEPS b/DEPS
index 41495cb..79b353f 100644
--- a/DEPS
+++ b/DEPS
@@ -3,6 +3,7 @@
vars = {
'chromium_git': 'https://chromium.googlesource.com',
+ 'dawn_git': 'https://dawn.googlesource.com',
'github_git': 'https://github.com',
'dawn_standalone': True,
@@ -86,6 +87,12 @@
'url': '{github_git}/g-truc/glm.git@06f084063fd6d9aa2ef6904517650700ae47b63d',
'condition': 'dawn_standalone',
},
+
+ # Our own pre-compiled Linux clang-format 7.0 for presubmit
+ 'third_party/clang-format': {
+ 'url': '{dawn_git}/clang-format@2451c56cd368676cdb230fd5ad11731ab859f1a3',
+ 'condition': 'dawn_standalone and checkout_linux',
+ },
}
hooks = [