Skip to content

Commit

Permalink
Add YAML formatting hook to pre-commit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
AndPuQing committed Jan 28, 2024
1 parent f78be7e commit 39787a0
Showing 1 changed file with 47 additions and 39 deletions.
86 changes: 47 additions & 39 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,53 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
files: (.*\.(py|md|yaml|yml|hook)|BUILD|.*\.BUILD|WORKSPACE)$
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: trailing-whitespace

- repo: local
hooks:
- id: black
name: Format with Black
entry: poetry run -C backend/app -- black
language: system
types: [python]
- id: autoflake
name: autoflake
entry: poetry run -C backend/app -- autoflake
language: system
types: [python]
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.1
hooks:
- id: yamlfmt

- id: flake8
name: Check with Flake8
entry: poetry run -C backend/app -- flake8
language: system
pass_filenames: false
types: [python]
args: [--count, .]
- repo: local
hooks:
- id: black
name: Format with Black
entry: poetry run -C backend/app -- black
language: system
types: [python]
- id: autoflake
name: autoflake
entry: poetry run -C backend/app -- autoflake
language: system
types: [python]

- id: ruff
name: Format with Ruff
entry: poetry run -C backend/app -- ruff
language: system
types: [python]
args: [--fix, --exit-non-zero-on-fix, --no-cache]
- id: flake8
name: Check with Flake8
entry: poetry run -C backend/app -- flake8
language: system
pass_filenames: false
types: [python]
args: [--count, .]

- id: ruff
name: Format with Ruff
entry: poetry run -C backend/app -- ruff
language: system
types: [python]
args: [--fix, --exit-non-zero-on-fix, --no-cache]

ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

0 comments on commit 39787a0

Please sign in to comment.