Commit Graph

388 Commits

Author SHA1 Message Date
Dylan ee2759b365
Bump 0.12.4 (#19406) 2025-07-17 12:14:01 -05:00
Alex Waygood c0d04f2d56
Fix typeshed-sync workflow (#19367) 2025-07-15 19:07:38 +01:00
Alex Waygood 8d7d02193e
Rework typeshed-sync workflow to also add docstrings for Windows- and MacOS-specific APIs (#19360) 2025-07-15 18:14:32 +01:00
Alex Waygood 560ae04346
Add shellcheck to pre-commit (#19361) 2025-07-15 16:49:13 +00:00
Brent Westbrook 5bc81f26c8
Bump 0.12.3 (#19279) 2025-07-11 09:07:50 -04:00
Ibraheem Ahmed 546f1b7b39
[ty] Add `set -eu` to mypy-primer script (#19212)
## Summary

So that the CI job fails if ty panics.
2025-07-08 12:16:09 -04:00
Alex Waygood 7533a0bfdb
[ty] Upgrade mypy_primer (#19207) 2025-07-08 15:56:54 +01:00
GiGaGon d78d10dd94
[`pycodestyle`] Make example not raise unnecessary `SyntaxError` (`E114`) (#19190)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Part of #18972

This PR makes [indentation-with-invalid-multiple-comment
(E114)](https://docs.astral.sh/ruff/rules/indentation-with-invalid-multiple-comment/#indentation-with-invalid-multiple-comment-e114)'s
example not raise a syntax error by adding a 4 space indented `...`. The
example still gave `E114` without this, but adding the `...` both makes
the change in indentation of the comment clearer, and makes it not give
a `SyntaxError`.

## Test Plan

<!-- How was it tested? -->

N/A, no functionality/tests affected
2025-07-08 10:00:14 -04:00
Ibraheem Ahmed cd848986d7
[ty] Add separate CI job for memory usage stats (#19134)
## Summary

As discussed in https://github.com/astral-sh/ruff/pull/19059.
2025-07-07 12:17:02 -04:00
Brent Westbrook 9bee8376a1
Bump 0.12.2 (#19126) 2025-07-03 12:27:24 -04:00
renovate[bot] c80762debd
Update pre-commit dependencies (#19038)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[astral-sh/ruff-pre-commit](https://redirect.github.com/astral-sh/ruff-pre-commit)
| repository | minor | `v0.11.13` -> `v0.12.1` |
|
[python-jsonschema/check-jsonschema](https://redirect.github.com/python-jsonschema/check-jsonschema)
| repository | patch | `0.33.0` -> `0.33.1` |
|
[rbubley/mirrors-prettier](https://redirect.github.com/rbubley/mirrors-prettier)
| repository | minor | `v3.5.3` -> `v3.6.2` |
|
[woodruffw/zizmor-pre-commit](https://redirect.github.com/woodruffw/zizmor-pre-commit)
| repository | minor | `v1.9.0` -> `v1.10.0` |

---

> [!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>astral-sh/ruff-pre-commit (astral-sh/ruff-pre-commit)</summary>

###
[`v0.12.1`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.12.1)

[Compare
Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.12.0...v0.12.1)

See: https://github.com/astral-sh/ruff/releases/tag/0.12.1

###
[`v0.12.0`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.12.0)

[Compare
Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.11.13...v0.12.0)

See: https://github.com/astral-sh/ruff/releases/tag/0.12.0

</details>

<details>
<summary>python-jsonschema/check-jsonschema
(python-jsonschema/check-jsonschema)</summary>

###
[`v0.33.1`](https://redirect.github.com/python-jsonschema/check-jsonschema/blob/HEAD/CHANGELOG.rst#0331)

[Compare
Source](https://redirect.github.com/python-jsonschema/check-jsonschema/compare/0.33.0...0.33.1)

- Update vendored schemas: bamboo-spec, bitbucket-pipelines, circle-ci,
cloudbuild,
compose-spec, dependabot, drone-ci, github-actions, github-workflows,
gitlab-ci,
mergify, readthedocs, renovate, taskfile, travis, woodpecker-ci
(2025-06-22)
- Fix: support `click==8.2.0`
- Fix a bug in `Last-Modified` header parsing which used local time and
could
  result in improper caching. Thanks :user:`fenuks`! (:pr:`565`)

</details>

<details>
<summary>rbubley/mirrors-prettier (rbubley/mirrors-prettier)</summary>

###
[`v3.6.2`](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.6.1...v3.6.2)

[Compare
Source](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.6.1...v3.6.2)

###
[`v3.6.1`](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.6.0...v3.6.1)

[Compare
Source](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.6.0...v3.6.1)

###
[`v3.6.0`](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.5.3...v3.6.0)

[Compare
Source](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.5.3...v3.6.0)

</details>

<details>
<summary>woodruffw/zizmor-pre-commit
(woodruffw/zizmor-pre-commit)</summary>

###
[`v1.10.0`](https://redirect.github.com/zizmorcore/zizmor-pre-commit/releases/tag/v1.10.0)

[Compare
Source](https://redirect.github.com/woodruffw/zizmor-pre-commit/compare/v1.9.0...v1.10.0)

See: https://github.com/zizmorcore/zizmor/releases/tag/v1.10.0

</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:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2025-06-30 08:43:39 +00:00
Dylan 32c54189cb
Bump 0.12.1 (#18969) 2025-06-26 15:20:31 -05:00
Brent Westbrook 87f0feb21a
Bump 0.12.0 (#18724)
- [x] Updated changelog
- [x] Updated breaking changes
2025-06-17 11:05:59 -04:00
Dylan 5faf72a4d9
Bump 0.11.13 (#18484) 2025-06-05 15:18:38 -05:00
Ibraheem Ahmed aa1fad61e0
Support relative `--ty-path` in ty-benchmark (#18385)
## Summary

This currently doesn't work because the benchmark changes the working
directory. Also updates the process name to make it easier to compare
two local ty binaries.
2025-05-30 18:19:20 -04:00
Brent Westbrook aee3af0f7a
Bump 0.11.12 (#18369) 2025-05-29 09:17:12 -04:00
Brent Westbrook 9925910a29
Add a `ViolationMetadata::rule` method (#18234)
Summary
--

This PR adds a macro-generated method to retrieve the `Rule` associated
with a given `Violation` struct, which makes it substantially cheaper
than parsing from the rule name. The rule is then converted to a
`NoqaCode` for storage on the `Message` (and eventually on the new
diagnostic type). The `ViolationMetadata::rule_name` method was now
unused, so the `rule` method replaces it.

Several types had to be moved from the `ruff_diagnostics` crate to the
`ruff_linter` crate to make this work, namely the `Violation` traits and
the old `Diagnostic` type, which had a constructor generic over a
`Violation`.

It's actually a fairly small PR, minus the hundreds of import changes.
The main changes are in these files:

-
[crates/ruff_linter/src/message/mod.rs](https://github.com/astral-sh/ruff/pull/18234/files#diff-139754ea310d75f28307008d21c771a190038bd106efe3b9267cc2d6c0fa0921)
-
[crates/ruff_diagnostics/src/lib.rs](https://github.com/astral-sh/ruff/pull/18234/files#diff-8e8ea5c586935bf21ea439f24253fcfd5955d2cb130f5377c2fa7bfee3ea3a81)
-
[crates/ruff_linter/src/diagnostic.rs](https://github.com/astral-sh/ruff/pull/18234/files#diff-1d0c9aad90d8f9446079c5be5f284150d97797158715bd9729e6f1f70246297a)
-
[crates/ruff_linter/src/lib.rs](https://github.com/astral-sh/ruff/pull/18234/files#diff-eb93ef7e78a612f5fa9145412c75cf6b1a5cefba1c2233e4a11a880a1ce1fbcc)

Test Plan
--

Existing tests
2025-05-28 09:27:09 -04:00
otakutyrant c3feb8ce27
Update editor integrations link in README (#17977)
Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-26 09:50:09 +01:00
Dylan 0397682f1f
Bump 0.11.11 (#18259) 2025-05-22 13:09:44 -05:00
Micha Reiser 9ae698fe30
Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
Brent Westbrook b35bf8ae07
Bump 0.11.10 (#18120) 2025-05-15 09:54:08 -04:00
Rogdham bc7b30364d
python_stdlib: update for 3.14 (#18014)
## Summary

Added version 3.14 to the script generating the `known_stdlib.rs` file.

Rebuilt the known stdlibs with latest version (2025.5.10) of [stdlibs
Python lib](https://pypi.org/project/stdlibs/) (which added support for
3.14.0b1).

_Note: Python 3.14 is now in [feature
freeze](https://peps.python.org/pep-0745/) so the modules in stdlib
should be stable._

_See also: #15506_

## Test Plan

The following command has been run. Using for tests the `compression`
module which been introduced with Python 3.14.
```sh
ruff check --no-cache --select I001 --target-version py314 --fix
```

With ruff 0.11.9:
```python
import base64
import datetime

import compression

print(base64, compression, datetime)
```

With this PR:
```python
import base64
import compression
import datetime   

print(base64, compression, datetime)
```
2025-05-11 11:25:54 -05:00
Dylan 2370297cde
Bump 0.11.9 (#17986) 2025-05-09 10:43:27 -05:00
Zanie Blue 91aa853b9c
Update the schemastore script to match changes in ty (#17952)
See https://github.com/astral-sh/ty/pull/273
2025-05-08 09:31:52 -05:00
Micha Reiser fa628018b2
Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
Micha Reiser b51c4f82ea
Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
Brent Westbrook 75effb8ed7
Bump 0.11.8 (#17766) 2025-05-01 10:19:58 -04:00
Dylan f7b48510b5
Bump 0.11.7 (#17613) 2025-04-24 13:06:38 -05:00
Brent Westbrook fcd50a0496
Bump 0.11.6 (#17449) 2025-04-17 09:20:29 -04:00
Dylan 7186d5e9ad
Bump 0.11.5 (#17337) 2025-04-10 11:57:44 -05:00
Brent Westbrook 95d6ed40cc
Bump 0.11.4 (#17212) 2025-04-04 14:09:10 -04:00
Brent Westbrook 755ece0c36
Bump 0.11.3 (#17173) 2025-04-03 09:05:40 -04:00
Brent Westbrook 4773878ee7
Bump 0.11.2 (#16896)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-03-21 09:17:07 -04:00
Dylan c1971fdde2
Bump 0.11.1 (#16871) 2025-03-20 09:50:46 -05:00
Micha Reiser 2cd25ef641
Ruff 0.11.0 (#16723)
## Summary

Follow-up release for Ruff v0.10 that now includes the following two
changes that we intended to ship but slipped:

* Changes to how the Python version is inferred when a `target-version`
is not specified (#16319)
* `blanket-noqa` (`PGH004`): Also detect blanked file-level noqa
comments (and not just line level comments).

## Test plan

I verified that the binary built on this branch respects the
`requires-python` setting
([logs](https://www.diffchecker.com/qyJWYi6W/), left: v0.10, right:
v0.11)
2025-03-14 13:57:56 +01:00
Micha Reiser 27e9d1fe3e
Ruff v0.10 Release (#16708)
Co-authored-by: dylwil3 <dylwil3@gmail.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2025-03-13 13:53:11 -04:00
Dylan 0dfa810e9a
Bump 0.9.10 (#16556) 2025-03-07 09:00:08 -06:00
Micha Reiser c4578162d5
[red-knot] Add support for `knot check <paths>` (#16375)
## Summary

This PR adds support for an optional list of paths that should be
checked to `knot check`.

E.g. to only check the `src` directory

```sh
knot check src
```

The default is to check all files in the project but users can reduce
the included files by specifying one or multiple optional paths.

The main two challenges with adding this feature were:

* We now need to show an error when one of the provided paths doesn't
exist. That's why this PR now collects errors from the project file
indexing phase and adds them to the output diagnostics. The diagnostic
looks similar to ruffs (see CLI test)
* The CLI should pick up new files added to included folders. For
example, `knot check src --watch` should pick up new files that are
added to the `src` folder. This requires that we now filter the files
before adding them to the project. This is a good first step to
supporting `include` and `exclude`.


The PR makes two simplifications:

1. I didn't test the changes with case-insensitive file systems. We may
need to do some extra path normalization to support those well. See
https://github.com/astral-sh/ruff/issues/16400
2. Ideally, we'd accumulate the IO errors from the initial indexing
phase and subsequent incremental indexing operations. For example, we
should preserve the IO diagnostic for a non existing `test.py` if it was
specified as an explicit CLI argument until the file gets created and we
should show it again when the file gets deleted. However, this is
somewhat complicated because we'd need to track which files we revisited
(or were removed because the entire directory is gone). I considered
this too low a priority as it's worth dealing with right now.

The implementation doesn't support symlinks within the project but that
is the same as Ruff and is unchanged from before this PR.



Closes https://github.com/astral-sh/ruff/issues/14193

## Test Plan

Added CLI and file watching integration tests. Manually testing.
2025-03-03 12:59:56 +00:00
Micha Reiser 091d0af2ab
Bump version to Ruff 0.9.9 (#16434) 2025-02-28 10:17:38 +01:00
Brent Westbrook 568cf88c6c
Bump version to 0.9.8 (#16414) 2025-02-27 08:56:11 -05:00
Micha Reiser 4732c58829
Rename `venv-path` to `python` (#16347) 2025-02-24 19:41:06 +01:00
Brent Westbrook 54fccb3ee2
Bump version to 0.9.7 (#16271) 2025-02-20 08:12:11 -05:00
InSync 1db8392a5a
Check for backtick-quoted shortcut links in CI (#16114)
## Summary

Follow-up to #16035.

`check_docs_formatted.py` will now report backtick-quoted shortcut links
in rule documentation. It uses a regular expression to find them. Such a
link:

* Starts with `[`, followed by <code>\`</code>, then a "name" sequence
of at least one non-backtick non-newline character, followed by another
<code>\`</code>, then ends with `]`.
* Is not followed by either a `[` or a `(`.
* Is not placed within a code block.

If the name is a known Ruff option name, that link is not considered a
violation.

## Test Plan

Manual.
2025-02-14 08:37:46 +01:00
Dhruv Manilawala 524cf6e515
Bump version to 0.9.6 (#16074) 2025-02-10 18:14:04 +05:30
InSync f367aa8367
[`ruff`] Indented form feeds (`RUF054`) (#16049)
## Summary

Resolves #12321.

The physical-line-based `RUF054` checks for form feed characters that
are preceded by only tabs and spaces, but not any other characters,
including form feeds.

## Test Plan

`cargo nextest run` and `cargo insta test`.
2025-02-09 19:23:48 -05:00
Dylan 10d3e64ccd
Bump version to 0.9.5 (#16002) 2025-02-06 13:24:45 -06:00
Dylan 854ab03078
Bump version to 0.9.4 (#15831)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-01-30 11:29:22 -06:00
Micha Reiser 9353482a5a
Add `check` command (#15692) 2025-01-24 17:00:30 +01:00
Dylan b5ffb404de
Bump version to 0.9.3 (#15698) 2025-01-23 12:43:56 -06:00
Calum Young 023c52d82b
Standardise ruff config (#15558) 2025-01-21 12:09:11 +01:00