refactor: simplify script/lint.js (#37077)
Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
23739c644b
commit
c6203d54d0
1 changed files with 2 additions and 5 deletions
|
@ -86,11 +86,8 @@ const LINTERS = [{
|
||||||
roots: ['shell'],
|
roots: ['shell'],
|
||||||
test: filename => filename.endsWith('.mm') || (filename.endsWith('.h') && isObjCHeader(filename)),
|
test: filename => filename.endsWith('.mm') || (filename.endsWith('.h') && isObjCHeader(filename)),
|
||||||
run: (opts, filenames) => {
|
run: (opts, filenames) => {
|
||||||
if (opts.fix) {
|
const clangFormatFlags = opts.fix ? ['--fix'] : [];
|
||||||
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', '--fix', ...filenames]);
|
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', ...clangFormatFlags, ...filenames]);
|
||||||
} else {
|
|
||||||
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', ...filenames]);
|
|
||||||
}
|
|
||||||
const filter = [
|
const filter = [
|
||||||
'-readability/braces',
|
'-readability/braces',
|
||||||
'-readability/casting',
|
'-readability/casting',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue