From 4612817a0281ffdc698ba496d5a0530011bb5449 Mon Sep 17 00:00:00 2001 From: Phil Cohen Date: Sat, 15 Oct 2022 07:00:35 -0700 Subject: [PATCH] talonfmt: raise maximum line length to 88 (#990) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Michael Arntzenius --- .editorconfig | 8 +------- .pre-commit-config.yaml | 2 +- apps/i3wm/i3wm.talon | 3 +-- apps/jetbrains/jetbrains.talon | 15 +++++---------- apps/thunderbird/thunderbird.talon | 3 +-- apps/vscode/vscode.talon | 9 +++------ core/modes/dictation_mode.talon | 3 +-- core/text/text.talon | 6 ++---- core/vocabulary/edit_vocabulary.talon | 3 +-- lang/python/python.talon | 6 ++---- lang/rust/rust.talon | 6 ++---- lang/tags/functions_common.talon | 3 +-- lang/tags/operators_bitwise.talon | 3 +-- lang/tags/operators_math.talon | 3 +-- plugin/datetimeinsert/datetimeinsert.talon | 3 +-- plugin/talon_helpers/talon_helpers.talon | 3 +-- tags/file_manager/file_manager.talon | 3 +-- tags/line_commands/line_commands.talon | 3 +-- 18 files changed, 27 insertions(+), 58 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6b11573050..0d6fd5f545 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,17 +7,11 @@ end_of_line = lf insert_final_newline = true indent_size = 4 indent_style = space -max_line_length = 80 +max_line_length = 88 trim_trailing_whitespace = true [*.{md,yaml,yml}] -indent_style = space indent_size = 2 -[*.py] -indent_style = space -indent_size = 4 -max_line_length = 88 - [Makefile] indent_style = tab diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 73eb70eac4..cd666c614c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,4 +49,4 @@ repos: rev: 1.8.0 hooks: - id: talonfmt - args: ["--in-place", "--max-line-width=80"] + args: ["--in-place", "--max-line-width=88"] diff --git a/apps/i3wm/i3wm.talon b/apps/i3wm/i3wm.talon index 0b9a99e697..960dd5de53 100644 --- a/apps/i3wm/i3wm.talon +++ b/apps/i3wm/i3wm.talon @@ -2,8 +2,7 @@ os: linux tag: user.i3wm - -port : - user.system_command("i3-msg workspace number {number_small}") +port : user.system_command("i3-msg workspace number {number_small}") port ten: user.system_command("i3-msg workspace number 10") (port flip | flipper): user.system_command("i3-msg workspace back_and_forth") port right: user.system_command("i3-msg workspace next") diff --git a/apps/jetbrains/jetbrains.talon b/apps/jetbrains/jetbrains.talon index 999729bbe2..ea5735dc4e 100644 --- a/apps/jetbrains/jetbrains.talon +++ b/apps/jetbrains/jetbrains.talon @@ -166,8 +166,7 @@ toggle power save: user.idea("action TogglePowerSave") toggle whitespace: user.idea("action EditorToggleShowWhitespaces") toggle indents: user.idea("action EditorToggleShowIndentLines") toggle line numbers: user.idea("action EditorToggleShowLineNumbers") -toggle (bread crumbs | breadcrumbs): - user.idea("action EditorToggleShowBreadcrumbs") +toggle (bread crumbs | breadcrumbs): user.idea("action EditorToggleShowBreadcrumbs") toggle gutter icons: user.idea("action EditorToggleShowGutterIcons") toggle wrap: user.idea("action EditorToggleUseSoftWraps") toggle parameters: user.idea("action ToggleInlineHintsAction") @@ -230,10 +229,8 @@ refactor until : clone : user.line_clone(number) #find/replace -clear last [over]: - user.idea("find prev {text}, action EditorBackSpace") -clear next [over]: - user.idea("find next {text}, action EditorBackSpace") +clear last [over]: user.idea("find prev {text}, action EditorBackSpace") +clear next [over]: user.idea("find next {text}, action EditorBackSpace") comment last [over]: user.idea("find prev {text}, action CommentByLineComment") comment next [over]: @@ -248,10 +245,8 @@ refactor last [over]: user.idea("find prev {text}, action Refactorings.QuickListPopupAction") refactor next [over]: user.idea("find next {text}, action Refactorings.QuickListPopupAction") -replace last [over]: - user.idea("find prev {text}, action EditorPaste") -replace next [over]: - user.idea("find next {text}, action EditorPaste") +replace last [over]: user.idea("find prev {text}, action EditorPaste") +replace next [over]: user.idea("find next {text}, action EditorPaste") select last [over]: user.idea("find prev {text}") select next [over]: user.idea("find next {text}") diff --git a/apps/thunderbird/thunderbird.talon b/apps/thunderbird/thunderbird.talon index 55c1c88378..4586eff3e3 100644 --- a/apps/thunderbird/thunderbird.talon +++ b/apps/thunderbird/thunderbird.talon @@ -10,6 +10,5 @@ go (mails | messages | inbox): user.tab_jump(1) go (calendar | lightning): user.thunderbird_mod("shift-c") go tasks: user.thunderbird_mod("shift-d") # open windows -(open address [book] | address book | open contacts): - user.thunderbird_mod("shift-b") +(open address [book] | address book | open contacts): user.thunderbird_mod("shift-b") dev tools: user.thunderbird_mod("shift-i") diff --git a/apps/vscode/vscode.talon b/apps/vscode/vscode.talon index 8bf4a17bbf..4518b6ad46 100644 --- a/apps/vscode/vscode.talon +++ b/apps/vscode/vscode.talon @@ -42,11 +42,9 @@ focus editor: user.vscode("workbench.action.focusActiveEditorGroup") show settings: user.vscode("workbench.action.openGlobalSettings") show settings json: user.vscode("workbench.action.openSettingsJson") show settings folder: user.vscode("workbench.action.openFolderSettings") -show settings folder json: - user.vscode("workbench.action.openFolderSettingsFile") +show settings folder json: user.vscode("workbench.action.openFolderSettingsFile") show settings workspace: user.vscode("workbench.action.openWorkspaceSettings") -show settings workspace json: - user.vscode("workbench.action.openWorkspaceSettingsFile") +show settings workspace json: user.vscode("workbench.action.openWorkspaceSettingsFile") show shortcuts: user.vscode("workbench.action.openGlobalKeybindings") show snippets: user.vscode("workbench.action.openSnippets") @@ -211,8 +209,7 @@ terminal last: user.vscode("workbench.action.terminal.focusPrevious") terminal split: user.vscode("workbench.action.terminal.split") terminal zoom: user.vscode("workbench.action.toggleMaximizedPanel") terminal trash: user.vscode("workbench.action.terminal.kill") -terminal toggle: - user.vscode_and_wait("workbench.action.terminal.toggleTerminal") +terminal toggle: user.vscode_and_wait("workbench.action.terminal.toggleTerminal") terminal scroll up: user.vscode("workbench.action.terminal.scrollUp") terminal scroll down: user.vscode("workbench.action.terminal.scrollDown") terminal : user.vscode_terminal(number_small) diff --git a/core/modes/dictation_mode.talon b/core/modes/dictation_mode.talon index b42e7b3713..f07b155f6c 100644 --- a/core/modes/dictation_mode.talon +++ b/core/modes/dictation_mode.talon @@ -62,8 +62,7 @@ clear right (character | characters): # Formatting formatted : user.dictation_insert_raw(format_text) -^format selection $: - user.formatters_reformat_selection(formatters) +^format selection $: user.formatters_reformat_selection(formatters) # Corrections scratch that: user.clear_last_phrase() diff --git a/core/text/text.talon b/core/text/text.talon index c8ad8d1368..5047b3e679 100644 --- a/core/text/text.talon +++ b/core/text/text.talon @@ -1,10 +1,8 @@ #provide both anchored and unachored commands via 'over' phrase $: user.insert_with_history(text) phrase over: user.insert_with_history(text) -{user.prose_formatter} $: - user.insert_formatted(prose, prose_formatter) -{user.prose_formatter} over: - user.insert_formatted(prose, prose_formatter) +{user.prose_formatter} $: user.insert_formatted(prose, prose_formatter) +{user.prose_formatter} over: user.insert_formatted(prose, prose_formatter) +$: user.insert_many(format_text_list) + over: user.insert_many(format_text_list) that: user.formatters_reformat_selection(user.formatters) diff --git a/core/vocabulary/edit_vocabulary.talon b/core/vocabulary/edit_vocabulary.talon index 45d053cd60..af01012a50 100644 --- a/core/vocabulary/edit_vocabulary.talon +++ b/core/vocabulary/edit_vocabulary.talon @@ -8,8 +8,7 @@ copy name to vocab [as ]$: # Automatically adds plural form by simply appending "s". copy noun to vocab [as ]$: user.add_selection_to_vocabulary(phrase or "", "noun") -copy to replacements as $: - user.add_selection_to_words_to_replace(phrase) +copy to replacements as $: user.add_selection_to_words_to_replace(phrase) # Automatically adds possessive form by appending "'s". copy name to replacements as $: user.add_selection_to_words_to_replace(phrase, "name") diff --git a/lang/python/python.talon b/lang/python/python.talon index 3615057a12..758fe1a491 100644 --- a/lang/python/python.talon +++ b/lang/python/python.talon @@ -36,8 +36,7 @@ self taught: "self." pie test: "pytest" state past: "pass" -raise {user.python_exception}: - user.insert_between("raise {python_exception}(", ")") +raise {user.python_exception}: user.insert_between("raise {python_exception}(", ")") except {user.python_exception}: "except {python_exception}:" dock string: user.code_comment_documentation() @@ -45,8 +44,7 @@ dock {user.python_docstring_fields}: insert("{python_docstring_fields}") edit.left() dock type {user.code_type}: user.insert_between(":type ", ": {code_type}") -dock returns type {user.code_type}: - user.insert_between(":rtype ", ": {code_type}") +dock returns type {user.code_type}: user.insert_between(":rtype ", ": {code_type}") toggle imports: user.code_toggle_libraries() import : diff --git a/lang/rust/rust.talon b/lang/rust/rust.talon index 1d699cd571..07db95e35f 100644 --- a/lang/rust/rust.talon +++ b/lang/rust/rust.talon @@ -84,11 +84,9 @@ is some: user.code_insert_is_not_null() implement (struct | structure): user.code_state_implements() ## for annotating function parameters -is implemented trait {user.code_trait}: - user.code_insert_trait_annotation(code_trait) +is implemented trait {user.code_trait}: user.code_insert_trait_annotation(code_trait) is implemented trait: ": impl " -returns implemented trait {user.code_trait}: - user.code_insert_return_trait(code_trait) +returns implemented trait {user.code_trait}: user.code_insert_return_trait(code_trait) returns implemented trait: " -> impl " ## for generic reference of traits diff --git a/lang/tags/functions_common.talon b/lang/tags/functions_common.talon index fe4cc22395..7e24f9915e 100644 --- a/lang/tags/functions_common.talon +++ b/lang/tags/functions_common.talon @@ -1,8 +1,7 @@ tag: user.code_functions_common - toggle funk: user.code_toggle_functions() -funk : - user.code_insert_function(code_common_function, "") +funk : user.code_insert_function(code_common_function, "") funk cell : user.code_select_function(number - 1, "") funk wrap : user.code_insert_function(code_common_function, edit.selected_text()) diff --git a/lang/tags/operators_bitwise.talon b/lang/tags/operators_bitwise.talon index 6d932d8e42..fffaaed5ec 100644 --- a/lang/tags/operators_bitwise.talon +++ b/lang/tags/operators_bitwise.talon @@ -7,8 +7,7 @@ tag: user.code_operators_bitwise # TODO: split these out into separate logical and bitwise operator commands -(op | logical | bitwise) (ex | exclusive) or: - user.code_operator_bitwise_exclusive_or() +(op | logical | bitwise) (ex | exclusive) or: user.code_operator_bitwise_exclusive_or() (op | logical | bitwise) (left shift | shift left): user.code_operator_bitwise_left_shift() (op | logical | bitwise) (right shift | shift right): diff --git a/lang/tags/operators_math.talon b/lang/tags/operators_math.talon index 3ae9b1816d..a1e1fddc75 100644 --- a/lang/tags/operators_math.talon +++ b/lang/tags/operators_math.talon @@ -14,8 +14,7 @@ op mod: user.code_operator_modulo() (op | is) not equal: user.code_operator_not_equal() (op | is) (greater | more): user.code_operator_greater_than() (op | is) (less | below) [than]: user.code_operator_less_than() -(op | is) greater [than] or equal: - user.code_operator_greater_than_or_equal_to() +(op | is) greater [than] or equal: user.code_operator_greater_than_or_equal_to() (op | is) less [than] or equal: user.code_operator_less_than_or_equal_to() # logical operators diff --git a/plugin/datetimeinsert/datetimeinsert.talon b/plugin/datetimeinsert/datetimeinsert.talon index adce1fa4ba..8b62cfabb6 100644 --- a/plugin/datetimeinsert/datetimeinsert.talon +++ b/plugin/datetimeinsert/datetimeinsert.talon @@ -1,8 +1,7 @@ date insert: insert(user.time_format("%Y-%m-%d")) date insert UTC: insert(user.time_format_utc("%Y-%m-%d")) timestamp insert: insert(user.time_format("%Y-%m-%d %H:%M:%S")) -timestamp insert high resolution: - insert(user.time_format("%Y-%m-%d %H:%M:%S.%f")) +timestamp insert high resolution: insert(user.time_format("%Y-%m-%d %H:%M:%S.%f")) timestamp insert UTC: insert(user.time_format_utc("%Y-%m-%d %H:%M:%S")) timestamp insert UTC high resolution: insert(user.time_format_utc("%Y-%m-%d %H:%M:%S.%f")) diff --git a/plugin/talon_helpers/talon_helpers.talon b/plugin/talon_helpers/talon_helpers.talon index 5e2101b75e..91d8dab3b6 100644 --- a/plugin/talon_helpers/talon_helpers.talon +++ b/plugin/talon_helpers/talon_helpers.talon @@ -39,8 +39,7 @@ talon dump context: ^talon debug tags$: user.talon_debug_tags() ^talon debug modes$: user.talon_debug_modes() ^talon debug scope {user.talon_scopes}$: user.talon_debug_scope(talon_scopes) -^talon debug setting {user.talon_settings}$: - user.talon_debug_setting(talon_settings) +^talon debug setting {user.talon_settings}$: user.talon_debug_setting(talon_settings) ^talon debug all settings$: user.talon_debug_all_settings() ^talon debug active app$: result = user.talon_get_active_application_info() diff --git a/tags/file_manager/file_manager.talon b/tags/file_manager/file_manager.talon index 1e30b0a720..13c839d5cf 100644 --- a/tags/file_manager/file_manager.talon +++ b/tags/file_manager/file_manager.talon @@ -24,8 +24,7 @@ go forward: user.file_manager_go_forward() ^file numb $: file = user.file_manager_get_file_by_index(number_small - 1) user.file_manager_select_file(file) -^file {user.file_manager_files}$: - user.file_manager_select_file(file_manager_files) +^file {user.file_manager_files}$: user.file_manager_select_file(file_manager_files) ^(select | cell) file {user.file_manager_files}$: user.file_manager_select_file(file_manager_files) diff --git a/tags/line_commands/line_commands.talon b/tags/line_commands/line_commands.talon index 69248f4d0b..96b2b6b009 100644 --- a/tags/line_commands/line_commands.talon +++ b/tags/line_commands/line_commands.talon @@ -36,8 +36,7 @@ cut [line] until : user.select_range(number_1, number_2) edit.paste() (select | cell | sell) [line] : user.select_range(number, number) -(select | cell | sell) until : - user.select_range(number_1, number_2) +(select | cell | sell) until : user.select_range(number_1, number_2) tab that: edit.indent_more() tab [line] : edit.jump_line(number)