Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat_refactor_2to3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
janstrohbeck committed Jul 9, 2020
2 parents 58f7437 + c8a149c commit a74bf6e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git-cmake-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ def requiresFormat(fileName, f_type, project):
if len(EditedFiles) < 1:
sys.exit(0)

EditedFiles = list(map(lambda f: os.path.join(GitRoot, f), EditedFiles))
UnstagedFiles = list(map(lambda f: os.path.join(GitRoot, f), UnstagedFiles))
EditedFiles = list([os.path.join(GitRoot, f) for f in EditedFiles])
UnstagedFiles = list([os.path.join(GitRoot, f) for f in UnstagedFiles])


common = set(EditedFiles) & set(UnstagedFiles)
if len(common) != 0:
Expand Down Expand Up @@ -266,7 +267,7 @@ def load_project_config(filename):
for f_type, patterns in linter_patterns.items():
project["source_files"][f_type] = list(filter(_matchesPattern(patterns), EditedFiles))
total_len = lambda _dict: sum([len(l) for l in _dict.values()])
projects = filter(lambda p: total_len(p["source_files"]) > 0 or total_len(p["formattable_files"]) > 0, projects)
projects = [p for p in projects if total_len(p["source_files"]) > 0 or total_len(p["formattable_files"]) > 0]

try:
filesToFormat = formatFiles(projects)
Expand Down

0 comments on commit a74bf6e

Please sign in to comment.