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

Error when running squawk on an excluded file #387

Open
PascalFrenz opened this issue Oct 4, 2024 · 0 comments
Open

Error when running squawk on an excluded file #387

PascalFrenz opened this issue Oct 4, 2024 · 0 comments
Labels

Comments

@PascalFrenz
Copy link

Hi, first of all thanks for providing this awesome tool!

Problem

We are using it in our CI Pipelines to check any changed or added files within a PR one by one. Sometimes we encounter the situation that we want to accept a breaking change, for example when changing the type of an unused column or dropping an unused column. We use the .squawk.toml and more specifically the excluded_paths array to do this.

Squawk is called like this:
squawk "$FILENAME"

We noticed that squawk exits with an error code (1) and prints the following error:
Failed to find files for provided patterns: ["<FILENAME>"]
<FILENAME> = the path to the changed file.

Digging into the source code a little bit, it seems like this check is responsible for the behavior:

squawk/cli/src/main.rs

Lines 172 to 178 in 0019f41

if found_paths.is_empty() && !opts.path_patterns.is_empty() {
eprintln!(
"Failed to find files for provided patterns: {:?}",
opts.path_patterns
);
process::exit(1);
}

Expected Behavior

When calling squawk with a path that is excluded via configuration, I would expect squawk to exit successfully (exit code 0). It could be helpful to print a message, stating that the file was ignored due to configuration.

Actual Behavior

Squawk exits with exit code 1, indicating a failure.

@sbdchd sbdchd added the bug label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants