django_template/.pre-commit-config.yaml

120 lines
4.6 KiB
YAML

---
# 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.5.0
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
# Simply check whether files parse as valid python.
#- id: check-ast
# Require literal syntax when initializing empty or zero Python builtin types.
#- id: check-builtin-literals
# Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT.
- id: check-case-conflict
# Checks for a common error of placing code before the docstring.
- id: check-docstring-first
# Checks that non-binary executables have a proper shebang.
- id: check-executables-have-shebangs
# Attempts to load all json files to verify syntax.
- id: check-json
exclude: (.devcontainer/devcontainer.json|.vscode/launch.json)
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks that scripts with shebangs are executable.
- id: check-shebang-scripts-are-executable
# Checks for symlinks which do not point to anything.
#- id: check-symlinks
# Attempts to load all TOML files to verify syntax.
- id: check-toml
# Ensures that links to vcs websites are permalinks.
#- id: check-vcs-permalinks
# Attempts to load all xml files to verify syntax.
#- id: check-xml
# Attempts to load all yaml files to verify syntax.
- id: check-yaml
# Check for debugger imports and py37+ breakpoint() calls in python source.
#- id: debug-statements
# Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
#- id: destroyed-symlinks
# Checks for the existence of AWS secrets that you have set up with the AWS CLI.
#- id: detect-aws-credentials
# Checks for the existence of private keys.
#- id: detect-private-key
# This hook replaces double quoted strings with single quoted strings.
#- id: double-quote-string-fixer
# Makes sure files end in a newline and only a newline.
- id: end-of-file-fixer
# Sort the lines in specified files (defaults to alphabetical).
#- id: file-contents-sorter
# removes UTF-8 byte order marker
- id: fix-byte-order-marker
# Add # -*- coding: utf-8 -*- to the top of python files.
#- id: fix-encoding-pragma
# Prevent addition of new git submodules.
#- id: forbid-new-submodules
# forbids any submodules in the repository.
#- id: forbid-submodules
# Replaces or checks mixed line ending.
- id: mixed-line-ending
# verifies that test files are named correctly.
#- id: name-tests-test
# Protect specific branches from direct checkins.
#- id: no-commit-to-branch
# Checks that all your JSON files are pretty. "Pretty" here means that keys are sorted and indented.
#- id: pretty-format-json
# Sorts entries in requirements.txt and constraints.txt and removes incorrect entry for pkg-resources==0.0.0
#- id: requirements-txt-fixer
# Sorts simple YAML files which consist only of top-level
#- id: sort-simple-yaml
# Trims trailing whitespace.
- id: trailing-whitespace
#- repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.8.0
# hooks:
# - id: mypy
# additional_dependencies: [types-all]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
- repo: https://github.com/iamthefij/docker-pre-commit
rev: v3.0.1
hooks:
- id: docker-compose-check
#- repo: https://github.com/hadolint/hadolint
# rev: v2.12.0
# hooks:
# - id: hadolint
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
#- repo: https://github.com/igorshubovych/markdownlint-cli
# rev: v0.39.0
# hooks:
# - id: markdownlint
# #- id: markdownlint-fix
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.1
hooks:
- id: gitleaks
- repo: https://github.com/sirosen/texthooks
rev: 0.6.4
hooks:
- id: alphabetize-codeowners
- id: fix-smartquotes
- id: fix-spaces
#- id: forbid-bidi-controls
- id: fix-ligatures
- repo: https://github.com/djlint/djLint
rev: v1.34.1
hooks:
- id: djlint-reformat-django
- id: djlint-django