Skip to content

Commit 2b23911

Browse files
Replace flynt with ruff FLY rules and bump pre-commit hooks (#3169)
## Summary - Remove the `flynt` pre-commit hook — ruff's `FLY002` rule (plus existing `UP031`/`UP032`) covers the same f-string conversions - Bump hook versions: `pre-commit-hooks` v4.4.0→v6.0.0, `Lucas-C` v1.5.1→v1.5.6, `ruff` v0.4.1→v0.15.1 - Bump `minimum_pre_commit_version` to 3.2.0 (required by `pre-commit-hooks` v6) - Add `FLY` to ruff lint select; add `UP045` to ignore list (same Talon runtime issue as `UP007` — see talonvoice/talon#634, tracked in #2151) - Apply ruff autofixes: `SIM905` in `default_vocabulary.py`, `C420` in `destinations.py` Closes #2308, closes #1885 ## Test plan - [x] `ruff check` passes clean - [x] `ruff format --check` passes clean - [x] `pnpm run compile` passes - [x] Pre-commit CI passes --------- Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
1 parent 3522bba commit 2b23911

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
minimum_pre_commit_version: "2.9.0"
1+
minimum_pre_commit_version: "3.2.0"
22
ci:
33
autoupdate_schedule: monthly
44
exclude: /vendor/|^data/playground/
@@ -15,11 +15,11 @@ repos:
1515
language: fail
1616
types: [symlink]
1717
- repo: https://github.com/Lucas-C/pre-commit-hooks
18-
rev: v1.5.1
18+
rev: v1.5.6
1919
hooks:
2020
- id: forbid-crlf
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
22-
rev: v4.4.0
22+
rev: v6.0.0
2323
hooks:
2424
- id: check-added-large-files
2525
- id: check-case-conflict
@@ -71,12 +71,8 @@ repos:
7171
files: ^data/fixtures/recorded/.*/[^/]*\.yml$
7272
language: system
7373
entry: pnpm exec ./packages/common/scripts/my-ts-node.js packages/cursorless-engine/src/scripts/transformRecordedTests/index.ts --check-marks
74-
- repo: https://github.com/ikamensh/flynt
75-
rev: "1.0.6"
76-
hooks:
77-
- id: flynt
7874
- repo: https://github.com/astral-sh/ruff-pre-commit
79-
rev: v0.4.1
75+
rev: v0.15.1
8076
hooks:
8177
- id: ruff
8278
args: [--fix, --exit-non-zero-on-fix]

cursorless-talon-dev/src/default_vocabulary.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# ruff: noqa: SIM905
2+
13
from talon import Context, Module
24

35
mod = Module()

cursorless-talon/src/cheatsheet/sections/destinations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
def get_destinations() -> list[ListItemDescriptor]:
55
insertion_modes = {
6-
**{p: "to" for p in get_raw_list("insertion_mode_to")},
6+
**dict.fromkeys(get_raw_list("insertion_mode_to"), "to"),
77
**get_raw_list("insertion_mode_before_after"),
88
}
99

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ target-version = "py311"
1212
extend-exclude = ["vendor", "data/playground/**/*.py"]
1313

1414
[tool.ruff.lint]
15-
select = ["E", "F", "C4", "I001", "UP", "SIM"]
16-
ignore = ["E501", "SIM105", "UP007", "UP035"]
15+
select = ["E", "F", "C4", "I001", "UP", "SIM", "FLY"]
16+
ignore = ["E501", "SIM105", "UP007", "UP035", "UP045"]
1717

1818
[tool.pyright]
1919
reportSelfClsParameterName = false

0 commit comments

Comments
 (0)