Skip to content

Commit

Permalink
Switch from black to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Apr 25, 2024
1 parent d5be7e7 commit 197eafd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,8 @@ repos:
hooks:
- id: flynt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
rev: v0.4.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
hooks:
- id: black
- id: ruff-format
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Place your settings in this file to overwrite default and user settings.
{
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff"
},
"[scm]": {
"editor.defaultFormatter": "AndreasArvidsson.andreas-talon"
Expand Down
2 changes: 1 addition & 1 deletion cursorless-talon/src/marks/decorated_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def cursorless_grapheme(m) -> str:
except AttributeError:
# NB: This represents unknown char in Unicode. It will be translated
# to "[unk]" by Cursorless extension.
return "\uFFFD"
return "\ufffd"


@mod.capture(
Expand Down
2 changes: 1 addition & 1 deletion cursorless-talon/src/private_api/private_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def cursorless_private_build_primitive_target(
return PrimitiveTarget(mark, modifiers)

def cursorless_private_build_list_target(
elements: list[Union[PrimitiveTarget, RangeTarget]]
elements: list[Union[PrimitiveTarget, RangeTarget]],
) -> Union[PrimitiveTarget, ListTarget]:
"""Cursorless private api low-level target builder: Create a list target"""
if len(elements) == 1:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ force-exclude = '''
'''

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

Expand Down

0 comments on commit 197eafd

Please sign in to comment.