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

Ruff fails to exclude a file, tries to parse it, and bails #4134

Closed
flying-sheep opened this issue Apr 27, 2023 · 4 comments
Closed

Ruff fails to exclude a file, tries to parse it, and bails #4134

flying-sheep opened this issue Apr 27, 2023 · 4 comments
Labels
question Asking for support or clarification

Comments

@flying-sheep
Copy link
Contributor

flying-sheep commented Apr 27, 2023

I have a git repository. Since it’s a cookiecutter template, it contains a directory called {{cookiecutter.project_name}}[sic]. I try to run Ruff on the other files in the repo like this:

$ ruff "--extend-exclude=\\{\\{cookiecutter.project_name\\}\\}/**" --force-exclude -v .
[2023-04-27][17:17:32][ruff::resolver][DEBUG] Ignored path via `exclude`: "/Users/phil/Dev/cookiecutter-scverse/.git"
error: TOML parse error at line 50, column 1
   |
50 | {% if cookiecutter.project_name.lower().replace('-', '_') != cookiecutter.package_name -%}
   | ^
invalid key

Ruff shouldn’t try to parse that TOML file, I’m excluding it!

@flying-sheep
Copy link
Contributor Author

I circumvented it by using pre-commit’s files key, but I guess for others this would still be an issue.

@charliermarsh
Copy link
Member

Hmm yeah, that does look like a bug. I thought I'd fixed this in #3588, just confirming that you're on a recent release?

@charliermarsh charliermarsh added the question Asking for support or clarification label Apr 27, 2023
@charliermarsh
Copy link
Member

The linked PR suggests v0.0.250 -- mind checking if something like v0.0.260 or newer resolves this?

@flying-sheep
Copy link
Contributor Author

Huh, did use a freshly installed command line Ruff to verify (without actually checking if it was the newest version), but now I can’t reproduce it.

Apologies!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for support or clarification
Projects
None yet
Development

No branches or pull requests

2 participants