Skip to content

Commit

Permalink
talonfmt: raise maximum line length to 88 (talonhub#990)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Michael Arntzenius <[email protected]>
  • Loading branch information
3 people authored Oct 15, 2022
1 parent 134c706 commit 4612817
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 58 deletions.
8 changes: 1 addition & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 1 addition & 2 deletions apps/i3wm/i3wm.talon
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
os: linux
tag: user.i3wm
-
port <number_small>:
user.system_command("i3-msg workspace number {number_small}")
port <number_small>: 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")
Expand Down
15 changes: 5 additions & 10 deletions apps/jetbrains/jetbrains.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -230,10 +229,8 @@ refactor <number> until <number>:
clone <number>: user.line_clone(number)

#find/replace
clear last <user.text> [over]:
user.idea("find prev {text}, action EditorBackSpace")
clear next <user.text> [over]:
user.idea("find next {text}, action EditorBackSpace")
clear last <user.text> [over]: user.idea("find prev {text}, action EditorBackSpace")
clear next <user.text> [over]: user.idea("find next {text}, action EditorBackSpace")
comment last <user.text> [over]:
user.idea("find prev {text}, action CommentByLineComment")
comment next <user.text> [over]:
Expand All @@ -248,10 +245,8 @@ refactor last <user.text> [over]:
user.idea("find prev {text}, action Refactorings.QuickListPopupAction")
refactor next <user.text> [over]:
user.idea("find next {text}, action Refactorings.QuickListPopupAction")
replace last <user.text> [over]:
user.idea("find prev {text}, action EditorPaste")
replace next <user.text> [over]:
user.idea("find next {text}, action EditorPaste")
replace last <user.text> [over]: user.idea("find prev {text}, action EditorPaste")
replace next <user.text> [over]: user.idea("find next {text}, action EditorPaste")
select last <user.text> [over]: user.idea("find prev {text}")
select next <user.text> [over]: user.idea("find next {text}")

Expand Down
3 changes: 1 addition & 2 deletions apps/thunderbird/thunderbird.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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")
9 changes: 3 additions & 6 deletions apps/vscode/vscode.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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 <number_small>: user.vscode_terminal(number_small)
Expand Down
3 changes: 1 addition & 2 deletions core/modes/dictation_mode.talon
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ clear right <number_small> (character | characters):

# Formatting
formatted <user.format_text>: user.dictation_insert_raw(format_text)
^format selection <user.formatters>$:
user.formatters_reformat_selection(formatters)
^format selection <user.formatters>$: user.formatters_reformat_selection(formatters)

# Corrections
scratch that: user.clear_last_phrase()
Expand Down
6 changes: 2 additions & 4 deletions core/text/text.talon
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#provide both anchored and unachored commands via 'over'
phrase <user.text>$: user.insert_with_history(text)
phrase <user.text> over: user.insert_with_history(text)
{user.prose_formatter} <user.prose>$:
user.insert_formatted(prose, prose_formatter)
{user.prose_formatter} <user.prose> over:
user.insert_formatted(prose, prose_formatter)
{user.prose_formatter} <user.prose>$: user.insert_formatted(prose, prose_formatter)
{user.prose_formatter} <user.prose> over: user.insert_formatted(prose, prose_formatter)
<user.format_text>+$: user.insert_many(format_text_list)
<user.format_text>+ over: user.insert_many(format_text_list)
<user.formatters> that: user.formatters_reformat_selection(user.formatters)
Expand Down
3 changes: 1 addition & 2 deletions core/vocabulary/edit_vocabulary.talon
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ copy name to vocab [as <phrase>]$:
# Automatically adds plural form by simply appending "s".
copy noun to vocab [as <phrase>]$:
user.add_selection_to_vocabulary(phrase or "", "noun")
copy to replacements as <phrase>$:
user.add_selection_to_words_to_replace(phrase)
copy to replacements as <phrase>$: user.add_selection_to_words_to_replace(phrase)
# Automatically adds possessive form by appending "'s".
copy name to replacements as <phrase>$:
user.add_selection_to_words_to_replace(phrase, "name")
Expand Down
6 changes: 2 additions & 4 deletions lang/python/python.talon
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@ 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()
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 <user.code_libraries>:
Expand Down
6 changes: 2 additions & 4 deletions lang/rust/rust.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions lang/tags/functions_common.talon
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
tag: user.code_functions_common
-
toggle funk: user.code_toggle_functions()
funk <user.code_common_function>:
user.code_insert_function(code_common_function, "")
funk <user.code_common_function>: user.code_insert_function(code_common_function, "")
funk cell <number>: user.code_select_function(number - 1, "")
funk wrap <user.code_common_function>:
user.code_insert_function(code_common_function, edit.selected_text())
Expand Down
3 changes: 1 addition & 2 deletions lang/tags/operators_bitwise.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions lang/tags/operators_math.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions plugin/datetimeinsert/datetimeinsert.talon
Original file line number Diff line number Diff line change
@@ -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"))
3 changes: 1 addition & 2 deletions plugin/talon_helpers/talon_helpers.talon
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions tags/file_manager/file_manager.talon
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ go forward: user.file_manager_go_forward()
^file numb <number_small>$:
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)

Expand Down
3 changes: 1 addition & 2 deletions tags/line_commands/line_commands.talon
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ cut [line] <number> until <number>:
user.select_range(number_1, number_2)
edit.paste()
(select | cell | sell) [line] <number>: user.select_range(number, number)
(select | cell | sell) <number> until <number>:
user.select_range(number_1, number_2)
(select | cell | sell) <number> until <number>: user.select_range(number_1, number_2)
tab that: edit.indent_more()
tab [line] <number>:
edit.jump_line(number)
Expand Down

0 comments on commit 4612817

Please sign in to comment.