Skip to content
Snippets Groups Projects
Commit af4f15d2 authored by Boman Romain's avatar Boman Romain
Browse files

use relpath in skip

parent b013a8be
No related branches found
No related tags found
1 merge request!58Improve Continuous Integration
Pipeline #1574 failed
......@@ -15,23 +15,20 @@ def all_files(root,
skips='*.git*;*build*',
single_level=False,
yield_folders=False):
print('all_files')
# self.checkPath(root)
patterns = patterns.split(';')
skips = skips.split(';')
for path, subdirs, files in os.walk(root):
print('processing folder', path)
if yield_folders:
files.extend(subdirs)
files.sort()
for name in files:
for pattern in patterns:
print(f'match {name} / {pattern} / {fnmatch.fnmatch(name, pattern)}')
if fnmatch.fnmatch(name, pattern):
fullname = os.path.join(path, name)
ok = True
for skip in skips:
if fnmatch.fnmatch(fullname, skip):
if fnmatch.fnmatch(os.path.relpath(fullname, start=root), skip):
ok = False
if ok:
yield fullname
......@@ -44,8 +41,7 @@ def main():
# loop over all files and format them
encs = {}
for f in all_files(os.getcwd(), patterns='*.cpp;*.c;*.h;*.hpp',
skips='*.git*;*build*'):
for f in all_files(os.getcwd(), patterns='*.cpp;*.c;*.h;*.hpp'):
print(f)
cmd = ['clang-format', "-style=file", "-i", f]
retcode = subprocess.call(cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment