-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($GitHooks): add more hooks for pre-commit
- Loading branch information
1 parent
99ca066
commit 5114647
Showing
2 changed files
with
71 additions
and
51 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,53 +1,61 @@ | ||
# See https://pre-commit.com/ for usage and config | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: isort | ||
name: isort | ||
stages: [commit] | ||
language: system | ||
entry: pipenv run isort | ||
types: [python] | ||
|
||
- id: black | ||
name: black | ||
stages: [commit] | ||
language: system | ||
entry: pipenv run black | ||
types: [python] | ||
|
||
- id: flake8 | ||
name: flake8 | ||
stages: [commit] | ||
language: system | ||
entry: pipenv run flake8 | ||
types: [python] | ||
exclude: setup.py | ||
|
||
- id: mypy | ||
name: mypy | ||
stages: [commit] | ||
language: system | ||
entry: pipenv run mypy | ||
types: [python] | ||
require_serial: true | ||
|
||
- id: pytest | ||
name: pytest | ||
stages: [commit] | ||
language: system | ||
# https://github.com/pytest-dev/pytest/issues/5502#issuecomment-1020761655 | ||
# Prevent Pytest logging error like: ValueError: I/O operation on closed file. | ||
entry: pipenv run pytest --cov --cov-report html --html=./build/.pytest_report/report.html --self-contained-html --log-cli-level=DEBUG -n auto | ||
types: [python] | ||
pass_filenames: false | ||
|
||
- id: pytest-cov | ||
name: pytest | ||
stages: [push] | ||
language: system | ||
# https://github.com/pytest-dev/pytest/issues/5502#issuecomment-1020761655 | ||
# Prevent Pytest logging error like: ValueError: I/O operation on closed file. | ||
entry: pipenv run pytest --cov --cov-fail-under=85 --capture=no --log-cli-level=INFO -n auto | ||
types: [python] | ||
pass_filenames: false | ||
# https://github.com/pre-commit/pre-commit-hooks/releases/tag/v4.3.0 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: [ --fix, lf ] | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: name-tests-test | ||
args: [ --pytest-test-first ] | ||
- id: detect-private-key | ||
- repo: local | ||
hooks: | ||
- id: isort | ||
name: isort | ||
stages: [ commit ] | ||
language: system | ||
entry: pipenv run isort | ||
types: [ python ] | ||
- id: black | ||
name: black | ||
stages: [ commit ] | ||
language: system | ||
entry: pipenv run black | ||
types: [ python ] | ||
- id: flake8 | ||
name: flake8 | ||
stages: [ commit ] | ||
language: system | ||
entry: pipenv run flake8 | ||
types: [ python ] | ||
exclude: setup.py | ||
- id: mypy | ||
name: mypy | ||
stages: [ commit ] | ||
language: system | ||
entry: pipenv run mypy | ||
types: [ python ] | ||
require_serial: true | ||
- id: pytest | ||
name: pytest | ||
stages: [ commit ] | ||
language: system | ||
# https://github.com/pytest-dev/pytest/issues/5502#issuecomment-1020761655 | ||
# Prevent Pytest logging error like: ValueError: I/O operation on closed file. | ||
entry: pipenv run pytest --cov --cov-report html --html=./build/.pytest_report/report.html --self-contained-html --log-cli-level=DEBUG -n auto | ||
types: [ python ] | ||
pass_filenames: false | ||
- id: pytest-cov | ||
name: pytest | ||
stages: [ push ] | ||
language: system | ||
# https://github.com/pytest-dev/pytest/issues/5502#issuecomment-1020761655 | ||
# Prevent Pytest logging error like: ValueError: I/O operation on closed file. | ||
entry: pipenv run pytest --cov --cov-fail-under=85 --capture=no --log-cli-level=INFO -n auto | ||
types: [ python ] | ||
pass_filenames: false |
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,3 +1,15 @@ | ||
[metadata] | ||
name = python_boilerplate | ||
version = 3.0.0 | ||
description = A boilerplate project for Python. | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/johnnymillergh/python_boilerplate | ||
author = Johnny Miller | ||
author_email = [email protected] | ||
license = Apache License 2.0 | ||
license_file = LICENSE | ||
|
||
[flake8] | ||
ignore = E203, E266, E501, W503 | ||
; PEP 8 - Maximum Line Length, https://peps.python.org/pep-0008/#maximum-line-length | ||
|