Skip to content

Commit

Permalink
Filter out ignored files before checking file existence (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Dec 7, 2024
1 parent 7c04d3b commit 66eaa5e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions wpiformat/wpiformat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,6 @@ def main():
else:
files.append(name)

# Throw an error if any files or directories don't exist
for f in files:
if not os.path.exists(f):
if not os.path.islink(f):
print(f"error: {f}: No such file or directory")
sys.exit(1)
else:
print(f"warning: {f}: Broken symlink")

# Convert relative paths of files to absolute paths
files = [os.path.abspath(name) for name in files]

Expand All @@ -454,6 +445,15 @@ def main():
# Don't check for changes in or run tasks on ignored files
files = filter_ignored_files(files)

# Throw an error if any files or directories don't exist
for f in files:
if not os.path.exists(f):
if not os.path.islink(f):
print(f"error: {f}: No such file or directory")
sys.exit(1)
else:
print(f"warning: {f}: Broken symlink")

# Determine name of main branch for generated file comparisons
branch_options = ["master", "main"]
main_branch = ""
Expand Down

0 comments on commit 66eaa5e

Please sign in to comment.