Skip to content

Commit 4fa46de

Browse files
authored
Switch from black to ruff (#2306)
See https://docs.astral.sh/ruff/formatter/ ## Checklist - [x] I have run Talon spoken form tests - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet
1 parent a1bb6e4 commit 4fa46de

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ repos:
7676
hooks:
7777
- id: flynt
7878
- repo: https://github.com/astral-sh/ruff-pre-commit
79-
rev: v0.1.11
79+
rev: v0.4.1
8080
hooks:
8181
- id: ruff
8282
args: [--fix, --exit-non-zero-on-fix]
83-
- repo: https://github.com/psf/black-pre-commit-mirror
84-
rev: 24.1.1
85-
hooks:
86-
- id: black
83+
- id: ruff-format

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
33
"[python]": {
4-
"editor.defaultFormatter": "ms-python.black-formatter"
4+
"editor.defaultFormatter": "charliermarsh.ruff"
55
},
66
"[scm]": {
77
"editor.defaultFormatter": "AndreasArvidsson.andreas-talon"

cursorless-talon/src/marks/decorated_mark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def cursorless_grapheme(m) -> str:
2323
except AttributeError:
2424
# NB: This represents unknown char in Unicode. It will be translated
2525
# to "[unk]" by Cursorless extension.
26-
return "\uFFFD"
26+
return "\ufffd"
2727

2828

2929
@mod.capture(

cursorless-talon/src/private_api/private_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def cursorless_private_build_primitive_target(
3131
return PrimitiveTarget(mark, modifiers)
3232

3333
def cursorless_private_build_list_target(
34-
elements: list[Union[PrimitiveTarget, RangeTarget]]
34+
elements: list[Union[PrimitiveTarget, RangeTarget]],
3535
) -> Union[PrimitiveTarget, ListTarget]:
3636
"""Cursorless private api low-level target builder: Create a list target"""
3737
if len(elements) == 1:

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ force-exclude = '''
88
'''
99

1010
[tool.ruff]
11-
select = ["E", "F", "C4", "I001", "UP", "SIM"]
12-
ignore = ["E501", "SIM105", "UP007", "UP035"]
1311
target-version = "py311"
1412
extend-exclude = ["vendor", "data/playground/**/*.py"]
1513

14+
[tool.ruff.lint]
15+
select = ["E", "F", "C4", "I001", "UP", "SIM"]
16+
ignore = ["E501", "SIM105", "UP007", "UP035"]
17+
1618
[tool.pyright]
1719
reportSelfClsParameterName = false

0 commit comments

Comments
 (0)