Commit Graph

7 Commits

Author SHA1 Message Date
Kai Ninomiya 82961129b0 Use canned CheckPatchFormatted instead of our own linting
This calls into git cl format, so it should always be consistent with
that.

Removes all the old clang-format scripts and dependencies.

Change-Id: I879577a5c1df81617ec0d33096ce7884f4413659
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24840
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-07-15 20:47:57 +00:00
Kai Ninomiya 01aeca22a9 Add .clang-format files and format more files
The .clang-format files tell clang-format to ignore certain directories
(replacing code in lint_clang_format.sh which will be removed).

$ git ls-tree -r master --name-only | grep '\.\(c\|h\|cpp\|gn\|gni\|mm\|m\|py\)$' | xargs ./append-space-to-files
$ git checkout -- generator/templates third_party/khronos/{KHR,vulkan}
$ git cl format --full --python

Followed by manual reformatting of a few things in Python for
readability.

Bug: none
Change-Id: I4c9e472cc9a5cd80c07286e808f4e597cfef5428
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24785
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-15 19:51:17 +00:00
Kai Ninomiya 97e434f5b9 Skip clang-format on Windows
PRESUBMIT.py calls into a shell script which we can't do on Windows.
Disabling this for now until we can find a way to lint on Windows.

Bug: dawn:486
Change-Id: Ica525a4a8b01ffde6a3b6170bd58cb4edc9c442d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24784
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-14 17:59:35 +00:00
Kai Ninomiya eafdef3818 Fix platform.system check in clang-format presubmit
I did this incorrectly in
https://dawn-review.googlesource.com/c/dawn/+/24640
because I forgot to actually look up what the platform.system() return
values were.

Bug: none
Change-Id: Ib81060d14339cf8cf52764ea779e4448ac92a148
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24686
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-07-12 16:05:48 +00:00
Kai Ninomiya d82ef86b79 Use buildtools clang-format
Previously, buildtools' copy of clang-format was stuck at 6.0, so we
used a custom built of 7.0. Now, buildtools' version is 11.0.

Bug: none
Change-Id: I8964bcfbea2d40284249427395c8d417fc77b18d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24640
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-07-10 17:49:18 +00:00
Corentin Wallez 4c35101b9c 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
2018-09-11 08:06:36 -04:00
Corentin Wallez 99612ae059 Initial CQ configuration
Change-Id: I6af1836b6a3dddab0291bb4166e94d57c9e5eaa0
2018-08-23 08:33:35 -04:00