From df9a2f224451e8ba9c5aadd6cc0105f1dcf0a89a Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Sun, 25 May 2025 17:46:33 +0800 Subject: [PATCH 1/2] docs(taplo): add toml formatter --- .taplo.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .taplo.toml diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 0000000000..36a3453ac9 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,4 @@ +include = ["pyproject.toml", ".taplo.toml"] + +[formatting] +indent_string = " " From d4f4352f09b0cd400439d81318a148c3201cbf6f Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Sun, 25 May 2025 20:25:49 +0800 Subject: [PATCH 2/2] docs(pre-commit): add taplo to pre-commit hook --- .pre-commit-config.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e09fb63e8..06bf4c2ed5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: debug-statements - id: no-commit-to-branch - id: check-merge-conflict - - id: check-toml + - id: check-toml # TOML linter (syntax checker) - id: check-yaml args: [ '--unsafe' ] # for mkdocs.yml - id: detect-private-key @@ -55,17 +55,22 @@ repos: stages: - post-commit + - repo: https://github.com/ComPWA/taplo-pre-commit + rev: v0.9.3 + hooks: + - id: taplo-format + - repo: local hooks: - id: format - name: Format + name: Format Python code via Poetry language: system pass_filenames: false entry: poetry format types: [ python ] - id: linter and test - name: Linters + name: Linters via Poetry language: system pass_filenames: false entry: poetry lint