Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out ignored files before checking file existence #296

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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