From e5f8b1c5693aa69d2d4e6dd42b183e90b775614a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Tue, 10 Mar 2026 11:22:11 +0100 Subject: [PATCH] Added pre commit hooks for Talon and Tree sitter query files --- .editorconfig | 4 +++- .pre-commit-config.yaml | 6 ++++++ .../src/cursorless_launch_configuration.talon-list | 1 + cursorless-talon-dev/src/cursorless_test.talon | 8 +++++--- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3388804143..8de6d7957c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,9 +11,11 @@ max_line_length = 80 trim_trailing_whitespace = true [*.{py,talon}] -indent_style = space indent_size = 4 +[*.talon] +preserve_multiline = true + [*.svg] insert_final_newline = false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54d45ab1a3..7beda29943 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -86,6 +86,12 @@ repos: args: [--fix, --exit-non-zero-on-fix] - id: ruff-format + - repo: https://github.com/cursorless-dev/talon-tools + rev: v0.1.9 + hooks: + - id: talon-fmt + - id: tree-sitter-fmt + - repo: https://github.com/lunarmodules/luacheck rev: v1.2.0 hooks: diff --git a/cursorless-talon-dev/src/cursorless_launch_configuration.talon-list b/cursorless-talon-dev/src/cursorless_launch_configuration.talon-list index a442cba4bf..8bb92f4578 100644 --- a/cursorless-talon-dev/src/cursorless_launch_configuration.talon-list +++ b/cursorless-talon-dev/src/cursorless_launch_configuration.talon-list @@ -2,6 +2,7 @@ list: user.cursorless_launch_configuration app: vscode win.title: /cursorless/ - + extension: "VSCode: Run" test: "VSCode: Test" test subset: "VSCode: Test (subset)" diff --git a/cursorless-talon-dev/src/cursorless_test.talon b/cursorless-talon-dev/src/cursorless_test.talon index 3035640ca9..b898257c29 100644 --- a/cursorless-talon-dev/src/cursorless_test.talon +++ b/cursorless-talon-dev/src/cursorless_test.talon @@ -23,7 +23,7 @@ test api insert and : test api insert snippet: user.cursorless_insert_snippet("Hello, $foo! My name is $bar!") -test api insert snippet : +test api insert snippet : user.cursorless_insert_snippet("Hello, $foo! My name is $bar!", cursorless_destination, "statement") test api wrap with snippet : user.cursorless_wrap_with_snippet("Hello, $foo! My name is $bar!", cursorless_target, "foo", "statement") @@ -33,8 +33,10 @@ test api alternate highlight nothing: user.private_cursorless_test_alternate_highlight_nothing() test api parsed chuck block: user.cursorless_x_custom_command("chuck block") -test api parsed take next token: user.cursorless_x_custom_command("take next token") -test api parsed change next instance: user.cursorless_x_custom_command("change next instance") +test api parsed take next token: + user.cursorless_x_custom_command("take next token") +test api parsed change next instance: + user.cursorless_x_custom_command("change next instance") test api parsed : user.cursorless_x_custom_command("chuck block ", cursorless_target) test api parsed plus :