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

problem with cache in combination with EXE001 #3163

Closed
xmatthias opened this issue Feb 23, 2023 · 2 comments
Closed

problem with cache in combination with EXE001 #3163

xmatthias opened this issue Feb 23, 2023 · 2 comments

Comments

@xmatthias
Copy link

xmatthias commented Feb 23, 2023

ruff version ruff 0.0.251

The premise is that a file is present in a project with the EXE ruleset enabled (the file violates this ruleset by not being executable).

touch random_file.py

echo "#!/usr/bin/env python" > random_file.py
# The file is now violating the EXE rule - as it's not executable.

Running ruff on this correctly identifies the problem. but after fixing it, ruff is not checking the file again properly, still reporting it as violation.
Running without cache (-n) shows correct results - but the error "returns from cache" after the run.

$ ruff . 
random_file.py:1:3: EXE001 Shebang is present but file is not executable
Found 1 error.
$ chmod +x random_file.py
$ ruff . 
random_file.py:1:3: EXE001 Shebang is present but file is not executable
Found 1 error.
$ ruff . -n
$ ruff . 
random_file.py:1:3: EXE001 Shebang is present but file is not executable

the only way i found to permanently fix this after fixing the violation is by removing cache (rm -rf .ruff_cache) - which i'm sure is not the indended way.

@ngnpope
Copy link
Contributor

ngnpope commented Feb 23, 2023

Duplicate of #3086, fixed in v0.0.252 by #3104.

@xmatthias
Copy link
Author

xmatthias commented Feb 23, 2023

Thanks - didn't see that.
as i updated yesterday evening, i was assuming i was using the latest version ...

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

No branches or pull requests

2 participants