-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Enable Ruff EXE (flake8-executable) #13346
Conversation
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
…ndows solution to executable bit (#15208) ## Summary I noticed that the solution mentioned in [shebang-not-executable (EXE001)](https://docs.astral.sh/ruff/rules/shebang-not-executable/#shebang-not-executable-exe001) was incorrect and likely copy-pasted from [shebang-missing-executable-file (EXE002)](https://docs.astral.sh/ruff/rules/shebang-missing-executable-file/#shebang-missing-executable-file-exe002) It was telling users to remove the executable bit from a non-executable file. Which does nothing. I also noticed locally that: - `chmod` wouldn't cause any file change to be noticed by git (`EXE` was also passing locally) under WSL - Using git allows anyone to fix this lint across OSes, for projects with CIs using git So I added a solution using [git update-index --chmod](https://git-scm.com/docs/git-update-index#Documentation/git-update-index.txt---chmod-x) ## Test Plan No test plan, doc changes only. As for running the chmod commands: python/typeshed#13346
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, these seem very useful!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the change here that the stub file was previously marked as executable for some reason, and now it (correctly) no longer is, because the lint rule picked up that it didn't have a shebang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly !
Ref #13295
https://docs.astral.sh/ruff/rules/#flake8-executable-exe
Lints about
#!
at the top of executable python files. (Doesn't affect Windows)