mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 15:14:19 -05:00
Tracking issue: https://github.com/charliermarsh/ruff/issues/2024 Implementation for EXE003, EXE004 and EXE005 of `flake8-executable` (shebang should contain "python", not have whitespace before, and should be on the first line) Please take in mind that this is my first rust contribution. The remaining EXE-rules are a combination of shebang (`lines.rs`), file permissions (`fs.rs`) and if-conditions (`ast.rs`). I was not able to find other rules that have interactions/dependencies in them. Any advice on how this can be best implemented would be very welcome. For autofixing `EXE005`, I had in mind to _move_ the shebang line to the top op the file. This could be achieved by a combination of `Fix::insert` and `Fix::delete` (multiple fixes per diagnostic), or by implementing a dedicated `Fix::move`, or perhaps in other ways. For now I've left it out, but keen on hearing what you think would be most consistent with the package, and pointer where to start (if at all). --- If you care about another testimonial: `ruff` not only helps staying on top of the many excellent flake8 plugins and other Python code quality tools that are available, it also applies them at baffling speed. (Planning to implement it soon for github.com/pandas-profiling/pandas-profiling (as largest contributor) and github.com/ing-bank/popmon.)