mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2025-09-10 17:20:41 +03:00
74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
# Refer for explanation to following link:
|
|
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md
|
|
|
|
# NOTE: use `lefthook install` when you make change in stages (groups like pre-commit, format, etc.)
|
|
|
|
pre-commit:
|
|
commands:
|
|
format:
|
|
run: lefthook run format
|
|
lint:
|
|
run: lefthook run lint
|
|
check-format:
|
|
run: lefthook run check-format
|
|
|
|
pre-push:
|
|
parallel: true
|
|
commands:
|
|
isort:
|
|
glob: "*.py"
|
|
run: isort --check-only {all_files}
|
|
black:
|
|
glob: "*.py"
|
|
run: black --check -S {all_files}
|
|
mypy:
|
|
glob: "*.py"
|
|
run: mypy bot_microservice --config-file pyproject.toml
|
|
flake8:
|
|
glob: "*.py"
|
|
run: flake8 {all_files}
|
|
|
|
format:
|
|
piped: true
|
|
parallel: false
|
|
commands:
|
|
# number prefix used to save ordering
|
|
1_autoflake:
|
|
glob: "*.py"
|
|
run: autoflake --recursive --ignore-init-module-imports --remove-all-unused-imports --remove-unused-variables --in-place {staged_files}
|
|
2_isort:
|
|
glob: "*.py"
|
|
run: isort --color --quiet {staged_files}
|
|
3_black:
|
|
glob: "*.py"
|
|
run: black -S {staged_files}
|
|
4_black_check:
|
|
glob: "*.py"
|
|
run: black --check -S {staged_files}
|
|
5_ruff:
|
|
glob: "*.py"
|
|
run: ruff bot_microservice
|
|
|
|
lint:
|
|
parallel: true
|
|
commands:
|
|
mypy:
|
|
glob: "*.py"
|
|
run: mypy bot_microservice --namespace-packages --config-file pyproject.toml
|
|
flake8:
|
|
glob: "*.py"
|
|
run: flake8 bot_microservice
|
|
ruff:
|
|
glob: "*.py"
|
|
run: ruff bot_microservice
|
|
|
|
check-format:
|
|
parallel: true
|
|
commands:
|
|
isort:
|
|
glob: "*.py"
|
|
run: isort --check-only {staged_files}
|
|
black:
|
|
glob: "*.py"
|
|
run: black --check -S {staged_files}
|