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-31 02:20:58 +08:00
|
|
|
{
|
|
|
|
"linters": {
|
|
|
|
"clang-format": {
|
|
|
|
"type": "script-and-regex",
|
2020-04-25 08:51:15 +08:00
|
|
|
"script-and-regex.script": "bash utils/arcanist/clang-format.sh",
|
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-31 02:20:58 +08:00
|
|
|
"script-and-regex.regex": "/^(?P<severity>[[:alpha:]]+)\n(?P<message>[^\n]+)\n(====|(?P<line>\\d),(?P<char>\\d)\n(?P<original>.*)>>>>\n(?P<replacement>.*)<<<<\n)$/s",
|
|
|
|
"include": [
|
|
|
|
"(\\.(cc|cpp|h)$)"
|
2020-08-05 08:49:56 +08:00
|
|
|
],
|
|
|
|
"exclude": [
|
|
|
|
"(^clang/test/)"
|
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-31 02:20:58 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|