Commit graph

14 commits

Author SHA1 Message Date
Jeremy Rose
c0d442364a
build: explicitly run scripts with python3 (#33720)
* build: explicitly run scripts with python3

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 13:21:55 +02:00
David Sanders
27ddf19f3c
chore: use pylint-2.7 (#33232)
* chore: use pylint-2.7

* chore: fix pylint errors
2022-03-22 20:17:35 -04:00
David Sanders
45e2f86fe0
chore: fix pylint-2.7 errors (#33233) 2022-03-21 11:11:21 +09:00
David Sanders
bbdca48cdb
fix: output Unix-style paths for git diffs on Win (#25763) 2020-10-05 10:40:40 -04:00
David Sanders
c075d14920
fix: python3 compatibility (#25762) 2020-10-05 15:00:35 +09:00
Cheng Zhao
436d5c9ac1
fix: use gn/clang-format from src (#19145)
* fix: use gn/clang-format from src

* fix: download clang-format in lint job

* chore: fix linting warning

* chore: get_path_in_buildtools => get_buildtools_executable

* chore: the clang-format npm package is not used
2019-07-09 17:40:26 +09:00
Jeremy Apthorp
2a4f5c3284 chore: add --fix option to lint:cpp (#14977)
* chore: add --fix option to lint:cpp

* fix lint errors
2018-10-15 22:59:45 -07:00
Heilig Benedek
2d186cb31a fix: close patch_file before deleting it (#15055) 2018-10-10 08:55:25 -05:00
Charles Kerr
e9a5b19223 feat: convenience command to apply all formatter patches (#14994)
* feat: convenience to apply all formatter patches

run-clang-format.py can create multiple patchfiles.
This change prints a command that can be pasted into
a shell to apply all of them together.

* feat: put all generated style diffs in one file

This way it will be easier to `git apply` fixes to multiple
fixed files at once.
2018-10-09 10:06:27 -04:00
Charles Kerr
1b3fdb18e3 fix: change subprocess.Popen calls to work on Linux too (#14689)
* fix: remove 'shell=True' when calling 'git diff'

Calling subprocess.Popen() with a list of args and shell=True causes
the args to be ignored, so ['git', 'diff', '--name-only', '--staged']
was turning into just 'git'. Instead of getting a list of changed
files, we got the --help message.

Two possible fixes: change it from a list to a single string, or remove
'shell=True'. The shell doesn't seem to be needed, so I chose that.

More reading: https://stackoverflow.com/questions/26417658/subprocess-call-arguments-ignored-when-using-shell-true-w-list

* fix: remove 'shell=True' when calling clang-format

Same problem / rationale as previous commit.

* fix: re-add shell=True for win; use different fix
2018-09-20 16:57:21 +10:00
Heilig Benedek
8e963f10ef fix: add shell = True to make clang-format work on Windows (#14121) 2018-09-07 09:49:43 +10:00
Shelley Vohr
ab7a90e82f feat: ability to apply patch to clang-format errors (#13576)
* feat: ability to apply patch to clang-format errors

* improve error message formatting

* fix line length linting error
2018-07-09 10:26:10 -05:00
Shelley Vohr
ee2c3607ad
fix patch output filename (#12742) 2018-04-27 21:43:04 -04:00
Shelley Vohr
21e5a2e071
Add clang-format script and precommit hook (#12651)
* add second arg to hook

* fix clang-format script

* remove format script

* help

* first pass at only checking formatting for changed files

* ensure clang-format only runs against changes

* add quiet option for print output

* fix script outputs for clang-format

* wrap conditional for exit error

* remove cpplint include ordering from brightray

* fix python style errors

* add clang-format to linting

* fix var error and add mm extension

* fix diff checking for commit hook

* show incorrectly formatted lines when linting fails

* don't try to check formatting for deleted files
2018-04-27 13:01:12 -04:00