New functionality for cformat (#7893)
Fixing complexity remove lambda PR review fixes #1 Removing unneccesary string substitution Handle -a and specified files Complexity rewrite, use pathlib
This commit is contained in:
parent
eb9c2429c6
commit
b353028ea5
4 changed files with 82 additions and 26 deletions
|
@ -68,3 +68,17 @@ def normpath(path):
|
|||
return Path(path)
|
||||
|
||||
return Path(os.environ['ORIG_CWD']) / path
|
||||
|
||||
|
||||
def c_source_files(dir_names):
|
||||
"""Returns a list of all *.c, *.h, and *.cpp files for a given list of directories
|
||||
|
||||
Args:
|
||||
|
||||
dir_names
|
||||
List of directories, relative pathing starts at qmk's cwd
|
||||
"""
|
||||
files = []
|
||||
for dir in dir_names:
|
||||
files.extend(file for file in Path(dir).glob('**/*') if file.suffix in ['.c', '.h', '.cpp'])
|
||||
return files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue