Skip to content

Commit

Permalink
chore: add taplo
Browse files Browse the repository at this point in the history
Taplo is an excellent tool to format/lint TOML files, and ensure
compliance with available JSON Schemas.

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Jan 23, 2025
1 parent 097888d commit 0aee1e1
Show file tree
Hide file tree
Showing 9 changed files with 255 additions and 230 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ repos:
additional_dependencies:
- '@biomejs/[email protected]'

- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- id: taplo-lint

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
Expand Down
10 changes: 10 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[schema]
path = "taplo://taplo.toml"

[formatting]
align_entries = true
indent_entries = false
indent_tables = true
reorder_arrays = true
reorder_inline_tables = true
reorder_keys = true
8 changes: 6 additions & 2 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ All notable changes to this project will be documented in this file.
<!-- markdownlint-disable strong-style -->
"""

# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] _{{ timestamp | date(format="%Y-%m-%d") }}_
Expand Down Expand Up @@ -47,12 +50,13 @@ body = """
{% endfor %}
{% endif %}
"""# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
"""

# template for the changelog footer
footer = """
<!-- generated by git-cliff on {{ now() | date(format="%Y-%m-%d") }}-->
"""

# remove the leading and trailing s
trim = true
# postprocessors
Expand Down
1 change: 1 addition & 0 deletions committed.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#:schema https://raw.githubusercontent.com/crate-ci/committed/refs/heads/master/config.schema.json
## Configuration for committed
##
## See <https://github.com/crate-ci/committed/blob/master/docs/reference.md>
Expand Down
7 changes: 7 additions & 0 deletions docs/scripts/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#:schema https://json.schemastore.org/ruff.json
extend = "../../pyproject.toml"

[lint]
ignore = [
"INP001", # Forbid implicit namespaces
]
6 changes: 0 additions & 6 deletions docs/scripts/ruff.toml

This file was deleted.

13 changes: 7 additions & 6 deletions examples/.ruff.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#:schema https://json.schemastore.org/ruff.json
extend = "../pyproject.toml"

[lint]
ignore = [
"S101", # Forbid assert statements
"D103", # Require docstring in public function
"D104", # Require docstring in public package
"PLR2004", # Forbid Magic Numbers
"S101", # Forbid assert statements
]

[lint.per-file-ignores]
"tests/**.py" = [
"INP001", # Forbid implicit namespaces
"PLR2004", # Forbid magic values
]
[lint.per-file-ignores]
"tests/**.py" = [
"INP001", # Forbid implicit namespaces
"PLR2004", # Forbid magic values
]
Loading

0 comments on commit 0aee1e1

Please sign in to comment.