Skip to content

Commit

Permalink
gh-267: move arguments from pre-commit to config files (#284)
Browse files Browse the repository at this point in the history
Closes #267. The main advantage here is when running the given tool it
will always work, rather than just via `pre-commit`. Previously
requested in
#230 (comment). Have
used `pyproject.toml` where possible.
  • Loading branch information
paddyroddy authored Oct 1, 2024
1 parent a736582 commit a78f030
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 48 deletions.
48 changes: 0 additions & 48 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,46 +30,6 @@ repos:
hooks:
- id: yamllint
args:
- >-
--config-data={
extends: default,
rules: {
anchors: enable,
braces: {
forbid: non-empty
},
brackets: {
forbid: non-empty
},
colons: enable,
commas: enable,
comments: {
min-spaces-from-content: 1
},
comments-indentation: enable,
document-end: disable,
document-start: enable,
empty-lines: enable,
empty-values: disable,
float-values: enable,
hyphens: enable,
indentation: enable,
key-duplicates: enable,
key-ordering: disable,
line-length: enable,
new-line-at-end-of-file: enable,
new-lines: enable,
octal-values: enable,
quoted-strings: {
quote-type: double,
required: only-when-needed
},
trailing-spaces: enable,
truthy: {
check-keys: false
}
}
}
- --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
Expand All @@ -86,15 +46,7 @@ repos:
rev: v0.23.1
hooks:
- id: toml-sort-fix
args:
- --all
- --in-place
- --spaces-indent-inline-array=4
- --trailing-comma-inline-array
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
args:
- --prose-wrap=always
- --quote-props=as-needed
3 changes: 3 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
proseWrap: always
quoteProps: as-needed
33 changes: 33 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
extends: default

rules:
anchors: enable
braces:
forbid: non-empty
brackets:
forbid: non-empty
colons: enable
commas: enable
comments:
min-spaces-from-content: 1
comments-indentation: enable
document-end: disable
document-start: enable
empty-lines: enable
empty-values: disable
float-values: enable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: enable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: enable
quoted-strings:
quote-type: double
required: only-when-needed
trailing-spaces: enable
truthy:
check-keys: false
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,9 @@ lint.select = [
lint.mccabe.max-complexity = 18

[tool.tomlsort]
all = true
in_place = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true
overrides."project.classifiers".inline_arrays = false
overrides."tool.ruff.lint.isort.section-order".inline_arrays = false

0 comments on commit a78f030

Please sign in to comment.