Commit Graph

7 Commits

Author SHA1 Message Date
Shivam Gupta 959eec1fdd
[NFC] Give better diagnose on clang-format not found error
Contributors often confused by whether this is a server or local issue.
2021-05-04 09:22:06 +05:30
Richard Smith c25da4b04a Fix arc lint's clang-format rule: only format the file we were asked to format.
This avoids diffs being applied in the work tree to files that are
supposed to be excluded (clang tests), allows arc to properly provide
interactive feedback for the formatting fixes, and reduces the number of
files that we format, in a change affecting N files, from N^2 to N.
2020-10-11 14:24:23 -07:00
Scott Linder ad08ecbd16 Use in-tree clang-format-diff.py as Arcanist linter
Summary:
The only guarantee there seems to be in the clang-format packaging is
that an executable called `clang-format` is in the PATH. Use the
in-tree `clang-format-diff.py` to avoid assuming anything else.

Also remove dead code for SVN repo and switch to `git diff-index` which
is the git plumbing equivalent of `git diff` in this case.

Reviewers: starsid, mehdi_amini, vitalybuka, fhahn, kadircet

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77428
2020-04-06 12:02:20 -04:00
Kadir Cetinkaya 3e1b8db309
Revert "Use git-clang-format as Arcanist linter"
This reverts commit 31b6e182f2.

As it was breaking `arc diff` workflow for multiple people.
2020-04-03 15:35:41 +02:00
Vitaly Buka 1aee1ae532 Use --style file instead of --style LLVM
LLVM includes .clang-format files which must be respected.
2020-04-03 01:37:56 -07:00
Siddhartha Bagaria 31b6e182f2 Use git-clang-format as Arcanist linter
D49116 was using clang-format-diff because at the time of its writing,
it needed to handle the subversion repo as well.

Differential Revision: https://reviews.llvm.org/D77363
2020-04-03 04:53:33 +00:00
Siddhartha Bagaria 3c371491a2 Setup clang-format as an Arcanist linter
Summary:
This uses clang-format-diff as a linter for Arcanist.

`arc lint` flow, also run as part of `arc diff` unless skipped with
`--nolint`, will now run the linter shell script on the changed files,
and prompt the user to accept the suggested changes.

Message when clang-format-diff is not installed:
{F6654094}

Example of the noise during code review when clang-format-diff is not installed:
https://reviews.llvm.org/differential/changeset/?ref=1115809

Prompt when clang-format-diff is installed and suggests edits:
{F6650223}

Reviewers: probinson, scott.linder

Reviewed By: scott.linder

Subscribers: scott.linder, MyDeveloperDay, JonasToth, danilaml, JDevlieghere, dberris, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D49116
2020-03-30 15:02:33 -04:00