mirror of https://github.com/astral-sh/ruff
5 Commits
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
a192d96880
|
Update pre-commit dependencies (#17073)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [abravalheri/validate-pyproject](https://redirect.github.com/abravalheri/validate-pyproject) | repository | patch | `v0.24` -> `v0.24.1` | | [astral-sh/ruff-pre-commit](https://redirect.github.com/astral-sh/ruff-pre-commit) | repository | patch | `v0.11.0` -> `v0.11.2` | | [crate-ci/typos](https://redirect.github.com/crate-ci/typos) | repository | minor | `v1.30.2` -> `v1.31.0` | | [python-jsonschema/check-jsonschema](https://redirect.github.com/python-jsonschema/check-jsonschema) | repository | minor | `0.31.3` -> `0.32.1` | | [woodruffw/zizmor-pre-commit](https://redirect.github.com/woodruffw/zizmor-pre-commit) | repository | patch | `v1.5.1` -> `v1.5.2` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. Note: The `pre-commit` manager in Renovate is not supported by the `pre-commit` maintainers or community. Please do not report any problems there, instead [create a Discussion in the Renovate repository](https://redirect.github.com/renovatebot/renovate/discussions/new) if you have any questions. --- ### Release Notes <details> <summary>abravalheri/validate-pyproject (abravalheri/validate-pyproject)</summary> ### [`v0.24.1`](https://redirect.github.com/abravalheri/validate-pyproject/releases/tag/v0.24.1) [Compare Source](https://redirect.github.com/abravalheri/validate-pyproject/compare/v0.24...v0.24.1) #### What's Changed - Fixed multi plugin id was read from the wrong place by [@​henryiii](https://redirect.github.com/henryiii) in [https://github.com/abravalheri/validate-pyproject/pull/240](https://redirect.github.com/abravalheri/validate-pyproject/pull/240) - Implemented alternative plugin sorting, [https://github.com/abravalheri/validate-pyproject/pull/243](https://redirect.github.com/abravalheri/validate-pyproject/pull/243) **Full Changelog**: https://github.com/abravalheri/validate-pyproject/compare/v0.24...v0.24.1 </details> <details> <summary>astral-sh/ruff-pre-commit (astral-sh/ruff-pre-commit)</summary> ### [`v0.11.2`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.11.2) [Compare Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.11.1...v0.11.2) See: https://github.com/astral-sh/ruff/releases/tag/0.11.2 ### [`v0.11.1`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.11.1) [Compare Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.11.0...v0.11.1) See: https://github.com/astral-sh/ruff/releases/tag/0.11.1 </details> <details> <summary>crate-ci/typos (crate-ci/typos)</summary> ### [`v1.31.0`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.31.0) [Compare Source](https://redirect.github.com/crate-ci/typos/compare/v1.30.3...v1.31.0) #### \[1.31.0] - 2025-03-28 ##### Features - Updated the dictionary with the [March 2025](https://redirect.github.com/crate-ci/typos/issues/1266) changes ### [`v1.30.3`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.30.3) [Compare Source](https://redirect.github.com/crate-ci/typos/compare/v1.30.2...v1.30.3) #### \[1.30.3] - 2025-03-24 ##### Features - Support detecting `go.work` and `go.work.sum` files </details> <details> <summary>python-jsonschema/check-jsonschema (python-jsonschema/check-jsonschema)</summary> ### [`v0.32.1`](https://redirect.github.com/python-jsonschema/check-jsonschema/blob/HEAD/CHANGELOG.rst#0321) [Compare Source](https://redirect.github.com/python-jsonschema/check-jsonschema/compare/0.32.0...0.32.1) - Fix the `check-meltano` hook to use `types_or`. Thanks :user:`edgarrmondragon`! (:pr:`543`) ### [`v0.32.0`](https://redirect.github.com/python-jsonschema/check-jsonschema/blob/HEAD/CHANGELOG.rst#0320) [Compare Source](https://redirect.github.com/python-jsonschema/check-jsonschema/compare/0.31.3...0.32.0) - Update vendored schemas: circle-ci, compose-spec, dependabot, github-workflows, gitlab-ci, mergify, renovate, taskfile (2025-03-25) - Add Meltano schema and pre-commit hook. Thanks :user:`edgarrmondragon`! (:issue:`540`) - Add Snapcraft schema and pre-commit hook. Thanks :user:`fabolhak`! (:issue:`535`) </details> <details> <summary>woodruffw/zizmor-pre-commit (woodruffw/zizmor-pre-commit)</summary> ### [`v1.5.2`](https://redirect.github.com/woodruffw/zizmor-pre-commit/releases/tag/v1.5.2) [Compare Source](https://redirect.github.com/woodruffw/zizmor-pre-commit/compare/v1.5.1...v1.5.2) See: https://github.com/woodruffw/zizmor/releases/tag/v1.5.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/astral-sh/ruff). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDcuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIwNy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Micha Reiser <micha@reiser.io> |
|
|
|
f1b2e85339
|
py-fuzzer: recommend using `uvx` rather than `uv run` to run the fuzzer (#14645) | |
|
|
e0f3eaf1dd
|
Turn the `fuzz-parser` script into a properly packaged Python project (#14606)
## Summary This PR gets rid of the `requirements.in` and `requirements.txt` files in the `scripts/fuzz-parser` directory, and replaces them with `pyproject.toml` and `uv.lock` files. The script is renamed from `fuzz-parser` to `py-fuzzer` (since it can now also be used to fuzz red-knot as well as the parser, following https://github.com/astral-sh/ruff/pull/14566), and moved from the `scripts/` directory to the `python/` directory, since it's now a (uv)-pip-installable project in its own right. I've been resisting this for a while, because conceptually this script just doesn't feel "complicated" enough to me for it to be a full-blown package. However, I think it's time to do this. Making it a proper package has several advantages: - It means we can run it from the project root using `uv run` without having to activate a virtual environment and ensure that all required dependencies are installed into that environment - Using a `pyproject.toml` file means that we can express that the project requires Python 3.12+ to run properly; this wasn't possible before - I've been running mypy on the project locally when I've been working on it or reviewing other people's PRs; now I can put the mypy config for the project in the `pyproject.toml` file ## Test Plan I manually tested that all the commands detailed in `python/py-fuzzer/README.md` work for me locally. --------- Co-authored-by: David Peter <sharkdp@users.noreply.github.com> |
|
|
|
04a922866a
|
Add basic docs for the parser crate (#11199)
## Summary This PR adds a basic README for the `ruff_python_parser` crate and updates the CONTRIBUTING docs with the fuzzer and benchmark section. Additionally, it also updates some inline documentation within the parser crate and splits the `parse_program` function into `parse_single_expression` and `parse_module` which will be called by matching against the `Mode`. This PR doesn't go into too much internal detail around the parser logic due to the following reasons: 1. Where should the docs go? Should it be as a module docs in `lib.rs` or in README? 2. The parser is still evolving and could include a lot of refactors with the future work (feedback loop and improved error recovery and resilience) --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> |
|
|
|
13ffb5bc19
|
Replace LALRPOP parser with hand-written parser (#10036)
(Supersedes #9152, authored by @LaBatata101) ## Summary This PR replaces the current parser generated from LALRPOP to a hand-written recursive descent parser. It also updates the grammar for [PEP 646](https://peps.python.org/pep-0646/) so that the parser outputs the correct AST. For example, in `data[*x]`, the index expression is now a tuple with a single starred expression instead of just a starred expression. Beyond the performance improvements, the parser is also error resilient and can provide better error messages. The behavior as seen by any downstream tools isn't changed. That is, the linter and formatter can still assume that the parser will _stop_ at the first syntax error. This will be updated in the following months. For more details about the change here, refer to the PR corresponding to the individual commits and the release blog post. ## Test Plan Write _lots_ and _lots_ of tests for both valid and invalid syntax and verify the output. ## Acknowledgements - @MichaReiser for reviewing 100+ parser PRs and continuously providing guidance throughout the project - @LaBatata101 for initiating the transition to a hand-written parser in #9152 - @addisoncrump for implementing the fuzzer which helped [catch](https://github.com/astral-sh/ruff/pull/10903) [a](https://github.com/astral-sh/ruff/pull/10910) [lot](https://github.com/astral-sh/ruff/pull/10966) [of](https://github.com/astral-sh/ruff/pull/10896) [bugs](https://github.com/astral-sh/ruff/pull/10877) --------- Co-authored-by: Victor Hugo Gomes <labatata101@linuxmail.org> Co-authored-by: Micha Reiser <micha@reiser.io> |