chore: add markdownlint and expand prettier pre-commit scope
This commit is contained in:
@@ -13,6 +13,14 @@ repos:
|
|||||||
- id: check-toml
|
- id: check-toml
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
|
|
||||||
|
# Markdown linting
|
||||||
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||||
|
rev: v0.45.0
|
||||||
|
hooks:
|
||||||
|
- id: markdownlint
|
||||||
|
args: [--fix]
|
||||||
|
files: \.(md|markdown)$
|
||||||
|
|
||||||
# TOML linting
|
# TOML linting
|
||||||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
||||||
rev: v2.14.0
|
rev: v2.14.0
|
||||||
@@ -86,10 +94,10 @@ repos:
|
|||||||
# Prettier with auto-format for pre-commit (CI uses --check)
|
# Prettier with auto-format for pre-commit (CI uses --check)
|
||||||
- id: prettier
|
- id: prettier
|
||||||
name: prettier
|
name: prettier
|
||||||
entry: bash -c 'export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin:$PATH" && cd frontend && if [ "${CI:-}" = "true" ]; then corepack yarn prettier --check src/; else corepack yarn prettier --write src/; fi'
|
entry: bash -c 'export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin:$PATH" && FILES=(); for file in "$@"; do FILES+=("$(realpath "$file")"); done && if [ "${CI:-}" = "true" ]; then corepack yarn --cwd frontend prettier --check "${FILES[@]}"; else corepack yarn --cwd frontend prettier --write "${FILES[@]}"; fi' --
|
||||||
language: system
|
language: system
|
||||||
files: ^frontend/.*\.(js|ts|vue|json|css|scss|md)$
|
files: \.(js|ts|vue|json|css|scss|md|markdown)$
|
||||||
pass_filenames: false
|
pass_filenames: true
|
||||||
|
|
||||||
# TypeScript type checking (same as CI)
|
# TypeScript type checking (same as CI)
|
||||||
- id: typescript-check
|
- id: typescript-check
|
||||||
|
|||||||
Reference in New Issue
Block a user