diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-10-08 19:38:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-08 19:38:44 +0300 |
| commit | ebe39ad5d1c4787cf74836c8b453fa4464051a5e (patch) | |
| tree | f6c52ae4a6c8498c9fe501d8e0170981c273350f /python/firstheader.py | |
| parent | 75bc27898db9347ef6ffa4734cfb9f88e25c7b85 (diff) | |
| parent | 74d5f2543c89bdea7b9a3dcb43dd62c38dfd2ed7 (diff) | |
Merge pull request #7260 from qlyoung/reformat-python
Reformat python
Diffstat (limited to 'python/firstheader.py')
| -rw-r--r-- | python/firstheader.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/firstheader.py b/python/firstheader.py index 19a85b63e5..bf50f33a33 100644 --- a/python/firstheader.py +++ b/python/firstheader.py @@ -9,21 +9,21 @@ include_re = re.compile('^#\s*include\s+["<]([^ ">]+)[">]', re.M) errors = 0 -files = subprocess.check_output(['git', 'ls-files']).decode('ASCII') +files = subprocess.check_output(["git", "ls-files"]).decode("ASCII") for fn in files.splitlines(): - if not fn.endswith('.c'): + if not fn.endswith(".c"): continue - if fn.startswith('tools/'): + if fn.startswith("tools/"): continue - with open(fn, 'r') as fd: + with open(fn, "r") as fd: data = fd.read() m = include_re.search(data) if m is None: - #sys.stderr.write('no #include in %s?\n' % (fn)) + # sys.stderr.write('no #include in %s?\n' % (fn)) continue - if m.group(1) in ['config.h', 'zebra.h', 'lib/zebra.h']: + if m.group(1) in ["config.h", "zebra.h", "lib/zebra.h"]: continue - sys.stderr.write('%s: %s\n' % (fn, m.group(0))) + sys.stderr.write("%s: %s\n" % (fn, m.group(0))) errors += 1 if errors: |
