Check for Unsupported Files and Display Errors and Warnings#1509
Check for Unsupported Files and Display Errors and Warnings#1509charliermarsh merged 5 commits intoastral-sh:mainfrom
Conversation
|
Thank you! I decided to make the "unsupported file type" thing a hard error. I may regret it, we'll see! |
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.203` -> `^0.0.204` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.204`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.204) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.203...v0.0.204) #### What's Changed - Trim CLI help during generation by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1492](https://togithub.com/charliermarsh/ruff/pull/1492) - Escape strings when formatting check messages by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1493](https://togithub.com/charliermarsh/ruff/pull/1493) - Add a "fix message" to every autofix-able check by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1489](https://togithub.com/charliermarsh/ruff/pull/1489) - Stop overriding locations for expressions within f-strings by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1494](https://togithub.com/charliermarsh/ruff/pull/1494) - Remove F831 by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1495](https://togithub.com/charliermarsh/ruff/pull/1495) - Fix detection of changed imports in isort plugin by [@​squiddy](https://togithub.com/squiddy) in [https://github.com/charliermarsh/ruff/pull/1504](https://togithub.com/charliermarsh/ruff/pull/1504) - Remove unused snapshots by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1497](https://togithub.com/charliermarsh/ruff/pull/1497) - Improve `T20X` ranges by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1502](https://togithub.com/charliermarsh/ruff/pull/1502) - Improve F811 range for function and class definitions by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1499](https://togithub.com/charliermarsh/ruff/pull/1499) - Improve PLW0120 range by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1500](https://togithub.com/charliermarsh/ruff/pull/1500) - Fix N818 range by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1503](https://togithub.com/charliermarsh/ruff/pull/1503) - Include fix commit message when showing violations together with source by [@​squiddy](https://togithub.com/squiddy) in [https://github.com/charliermarsh/ruff/pull/1505](https://togithub.com/charliermarsh/ruff/pull/1505) - Fix E722 and F707 ranges by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1508](https://togithub.com/charliermarsh/ruff/pull/1508) - Adjust `test_path` helper to detect round-trip autofix issues by [@​squiddy](https://togithub.com/squiddy) in [https://github.com/charliermarsh/ruff/pull/1501](https://togithub.com/charliermarsh/ruff/pull/1501) - Generate source code with detected line ending by [@​squiddy](https://togithub.com/squiddy) in [https://github.com/charliermarsh/ruff/pull/1487](https://togithub.com/charliermarsh/ruff/pull/1487) - Check for Unsupported Files and Display Errors and Warnings by [@​saadmk11](https://togithub.com/saadmk11) in [https://github.com/charliermarsh/ruff/pull/1509](https://togithub.com/charliermarsh/ruff/pull/1509) **Full Changelog**: astral-sh/ruff@v0.0.203...v0.0.204 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9--> Signed-off-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
Zulip has many Python scripts that are marked executable with a shebang line but without a |
|
Do you want / expect those to be linted? If so, how have you linted them in the past, given that we only check |
|
We can change this to just attempt to lint them, which would raise a syntax error for any non-Python files that are passed directly. |
|
We linted all files passed directly on the command line, regardless of extension, until pretty recently (I’m checking where this changed). |
|
Okay, I'm happy to revert to that behavior. |
|
(I guess my question was: are you passing those directly on the command line?) |
|
Yes, Zulip has a wrapper script that finds all the Python files in the Git repository via extensions and shebang lines, and passes them directly on the command line. |
|
Ok, I can fix this later tonight. Or feel free to send a PR of course. Sorry for the trouble. |
|
(The problem isn’t urgent for Zulip, since Zulip uses a pinned version of Ruff.) |
|
Tracking here: #1541 |
closes #1473
Reference:
Originally posted by @charliermarsh in #1473 (comment)