Skip to content

docs(taplo): add toml formatter #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include = ["pyproject.toml", ".taplo.toml"]

[formatting]
indent_string = " "
12 changes: 2 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,7 @@ cover.help = "Run the test suite with coverage"
cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen"

all.help = "Run all tasks"
all.sequence = [
"format",
"lint",
"cover",
"check-commit",
]
all.sequence = ["format", "lint", "cover", "check-commit"]

"doc:screenshots".help = "Render documentation screenshots"
"doc:screenshots".script = "scripts.gen_cli_help_screenshots:gen_cli_help_screenshots"
Expand All @@ -267,10 +262,7 @@ doc.help = "Live documentation server"
doc.cmd = "mkdocs serve"

ci.help = "Run all tasks in CI"
ci.sequence = [
{ cmd = "pre-commit run --all-files" },
"cover",
]
ci.sequence = [{ cmd = "pre-commit run --all-files" }, "cover"]
ci.env = { SKIP = "no-commit-to-branch" }

setup-pre-commit.help = "Install pre-commit hooks"
Expand Down