pre-commit & package.json: enable corepack, unify local hooks under one local repo

This commit is contained in:
Aminda Suomalainen 2024-07-04 06:53:44 +03:00
parent d03fcbc92b
commit 9074a0633b
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 26 additions and 14 deletions

View File

@ -11,7 +11,7 @@ ci:
# the frequency of unnecessary PRs.
# https://github.com/pre-commit-ci/issues/issues/83
autoupdate_schedule: quarterly
skip: [pylint, prettier]
skip: [pnpm-install-dev, prettier, pylint]
# use pypy3 for python
default_language_version:
@ -74,12 +74,7 @@ repos:
rev: v3.1.0
hooks:
- id: add-trailing-comma
- repo: local
hooks:
- id: prettier
name: prettier
entry: pnpm exec prettier --cache --ignore-unknown --write
language: system
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
@ -92,12 +87,7 @@ repos:
# hooks:
# - id: shfmt
#- id: shfmt-docker
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "2.7.3"
hooks:
- id: editorconfig-checker
alias: ec
args: [-disable-max-line-length]
- repo: local
hooks:
- id: pylint
@ -106,3 +96,24 @@ repos:
entry: pylint -j 0 -d W0511
language: system
types_or: [python, pyi]
- id: pnpm-install-dev
name: Install pnpm dev dependencies
entry: corepack pnpm install -D
language: system
always_run: true
#verbose: true
pass_filenames: false
- id: prettier
name: prettier
entry: corepack pnpm exec prettier --cache --ignore-unknown --write
language: system
# Better handled by pretty-format-json from pre-commit-hooks.
# Remember to have *.json in .prettierignore!
exclude_types: [json]
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "2.7.3"
hooks:
- id: editorconfig-checker
alias: ec
args: [-disable-max-line-length]

View File

@ -3,5 +3,6 @@
"@prettier/plugin-ruby": "4.0.4",
"prettier": "3.3.2",
"prettier-plugin-sh": "0.14.0"
}
},
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
}