-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #788 from PCMDI/787_ljw_pre-commit-hook
I am merging this PR and will open another PR for make existing files to be compliant to the pre-commit-hook
- Loading branch information
Showing
2 changed files
with
67 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
exclude: "docs|node_modules|migrations|.git|.tox" | ||
default_stages: [commit] | ||
fail_fast: true | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
|
||
# Need to use flake8 GitHub mirror due to CentOS git issue with GitLab | ||
# https://github.com/pre-commit/pre-commit/issues/1206 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: ["--config=setup.cfg"] | ||
additional_dependencies: [flake8-isort] | ||
exclude: ^sample_setups/jsons/ | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.910 | ||
hooks: | ||
- id: mypy | ||
args: ["--config=setup.cfg"] |
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,4 +1,42 @@ | ||
[flake8] | ||
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes | ||
ignore = | ||
# whitespace before ‘:’ | ||
E203 | ||
# line too long (82 > 79 characters) | ||
E501 | ||
# line break before operator | ||
W503 | ||
# Max width of Github code review is 119 characters | ||
max-line-length = 119 | ||
max-complexity = 10 | ||
exclude = | ||
.tox | ||
.git | ||
*/migrations/* | ||
*/static/CACHE/* | ||
docs | ||
node_modules | ||
.idea | ||
.mypy_cache | ||
.pytest_cache | ||
*__init__.py | ||
venv | ||
*json | ||
|
||
[mypy] | ||
python_version = 3.8 | ||
check_untyped_defs = True | ||
ignore_missing_imports = True | ||
warn_unused_ignores = True | ||
warn_redundant_casts = True | ||
warn_unused_configs = True | ||
|
||
[aliases] | ||
# Define setup.py command aliases here | ||
test = pytest | ||
|
||
[tool:pytest] | ||
junit_family=xunit2 | ||
junit_family = xunit2 | ||
addopts = --cov=pcmdi_metrics --cov-report term --cov-report html:tests_coverage_reports/htmlcov --cov-report xml:tests_coverage_reports/coverage.xml -s --ignore tests/deprecated | ||
python_files = tests.py test_*.py | ||
python_files = tests.py test_*.py |