-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add YAML formatting hook to pre-commit configuration
- Loading branch information
Showing
1 changed file
with
47 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |