Compare commits

...

1 Commits

6 changed files with 58 additions and 48 deletions

View File

@@ -1,9 +1,4 @@
# This file configures pre-commit hooks.
# See https://pre-commit.com/ for general information
# See https://pre-commit.com/hooks.html for a listing of possible hooks
# We actually run via https://github.com/j178/prek which is compatible
repos: repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0 rev: v6.0.0
hooks: hooks:
@@ -11,21 +6,16 @@ repos:
- id: check-json - id: check-json
exclude: "tsconfig.*json" exclude: "tsconfig.*json"
- id: check-yaml - id: check-yaml
args: args: ["--unsafe"]
- "--unsafe"
- id: check-toml - id: check-toml
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
- id: end-of-file-fixer - id: end-of-file-fixer
exclude_types: exclude_types: [svg, pofile]
- svg
- pofile
exclude: "(^LICENSE$|^src/documents/static/bootstrap.min.css$)" exclude: "(^LICENSE$|^src/documents/static/bootstrap.min.css$)"
- id: mixed-line-ending - id: mixed-line-ending
args: args: ["--fix=lf"]
- "--fix=lf"
- id: trailing-whitespace - id: trailing-whitespace
exclude_types: exclude_types: [svg]
- svg
- id: check-case-conflict - id: check-case-conflict
- id: detect-private-key - id: detect-private-key
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
@@ -33,53 +23,29 @@ repos:
hooks: hooks:
- id: codespell - id: codespell
additional_dependencies: [tomli] additional_dependencies: [tomli]
exclude_types: exclude_types: [pofile, json]
- pofile - repo: https://github.com/google/yamlfmt
- json rev: v0.21.0
# See https://github.com/prettier/prettier/issues/15742 for the fork reason
- repo: https://github.com/rbubley/mirrors-prettier
rev: 'v3.8.1'
hooks: hooks:
- id: prettier - id: yamlfmt
types_or: exclude: "^src-ui/pnpm-lock.yaml"
- javascript types: [yaml]
- ts
- markdown
additional_dependencies:
- prettier@3.3.3
- 'prettier-plugin-organize-imports@4.1.0'
# Python hooks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff-check
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.12.1"
hooks:
- id: pyproject-fmt
# Dockerfile hooks
- repo: https://github.com/AleksaC/hadolint-py - repo: https://github.com/AleksaC/hadolint-py
rev: v2.14.0 rev: v2.14.0
hooks: hooks:
- id: hadolint - id: hadolint
# Shell script hooks
- repo: https://github.com/lovesegfault/beautysh - repo: https://github.com/lovesegfault/beautysh
rev: v6.4.2 rev: v6.4.2
hooks: hooks:
- id: beautysh - id: beautysh
types: [file] types: [file]
files: (\.sh$|/run$|/finish$) files: (\.sh$|/run$|/finish$)
args: args: ["--tab"]
- "--tab"
- repo: https://github.com/shellcheck-py/shellcheck-py - repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.11.0.1" rev: "v0.11.0.1"
hooks: hooks:
- id: shellcheck - id: shellcheck
- repo: https://github.com/google/yamlfmt - repo: https://github.com/tox-dev/pyproject-fmt
rev: v0.21.0 rev: "v2.16.2"
hooks: hooks:
- id: yamlfmt - id: pyproject-fmt
exclude: "^src-ui/pnpm-lock.yaml"
types:
- yaml

View File

@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff-check
- id: ruff-format

6
docs/.markdownlint.yaml Normal file
View File

@@ -0,0 +1,6 @@
default: true
MD013: false # line length -- mdformat handles this
MD033: false # inline HTML -- MkDocs uses it
MD041: false # first line heading -- not always true in MkDocs
MD046: # code block style
style: fenced

View File

@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/executablebooks/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
- mdformat-mkdocs
- mdformat-ruff
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.21.0
hooks:
- id: markdownlint-cli2
args: ["--config", ".markdownlint.yaml"]

View File

@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/rbubley/mirrors-prettier
rev: 'v3.8.1'
hooks:
- id: prettier
types_or: [javascript, ts]
additional_dependencies:
- prettier@3.3.3
- 'prettier-plugin-organize-imports@4.1.0'

10
src/.pre-commit-config.yaml Executable file
View File

@@ -0,0 +1,10 @@
orphan: true
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
hooks:
- id: ruff-check
- id: ruff-format