Skip to content

Commit 906a2ae

Browse files
auscompgeekpre-commit-ci[bot]pokey
authored
Switch from shed to ruff (#1375)
https://github.com/charliermarsh/ruff ## Checklist - [ ] 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) - [ ] I have not broken the cheatsheet --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Pokey Rule <[email protected]>
1 parent 70a4ff9 commit 906a2ae

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/actions/reformat.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ class Actions:
1212
def cursorless_reformat(targets: dict, formatters: str):
1313
"""Reformat targets with formatter"""
1414
texts = get_text(targets, show_decorations=False)
15-
updated_texts = list(
16-
map(lambda text: actions.user.reformat_text(text, formatters), texts)
17-
)
15+
updated_texts = [actions.user.reformat_text(text, formatters) for text in texts]
1816
actions.user.cursorless_replace(targets, updated_texts)

src/cheatsheet/cheat_sheet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def cursorless_open_instructions():
4040

4141

4242
@ctx.action_class("user")
43-
class Actions:
43+
class CursorlessActions:
4444
def cursorless_cheat_sheet_show_html():
4545
"""Show cursorless html cheat sheet"""
4646
# On Linux browsers installed using snap can't open files in a hidden directory
@@ -78,7 +78,7 @@ def cheatsheet_dir_linux() -> Path:
7878
import platformdirs
7979

8080
return Path(platformdirs.user_documents_dir())
81-
except:
81+
except Exception:
8282
# 2. Look for a documents directory in user home
8383
user_documents_dir = Path.home() / "Documents"
8484
if user_documents_dir.is_dir():

src/cheatsheet/sections/modifiers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def get_modifiers():
8282
"type": "modifier",
8383
"variations": [
8484
{
85-
"spokenForm": f"<scope>",
85+
"spokenForm": "<scope>",
8686
"description": "Containing instance of <scope>",
8787
},
8888
],
@@ -130,7 +130,7 @@ def get_modifiers():
130130
"description": "<number> instances of <scope> including target, going backwards",
131131
},
132132
{
133-
"spokenForm": f"<number> <scope>s",
133+
"spokenForm": "<number> <scope>s",
134134
"description": "<number> instances of <scope> including target, going forwards",
135135
},
136136
{
@@ -144,7 +144,7 @@ def get_modifiers():
144144
"type": "modifier",
145145
"variations": [
146146
{
147-
"spokenForm": f"<ordinal> <scope>",
147+
"spokenForm": "<ordinal> <scope>",
148148
"description": "<ordinal> instance of <scope> in iteration scope",
149149
},
150150
{

src/csv_overrides.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def update_file(
231231
"See release notes for more info: "
232232
"https://github.com/cursorless-dev/cursorless/blob/main/CHANGELOG.md"
233233
)
234-
app.notify(f"🎉🎉 New cursorless features; see log")
234+
app.notify("🎉🎉 New cursorless features; see log")
235235

236236
return current_values
237237

0 commit comments

Comments
 (0)