Skip to content

Commit

Permalink
update pre-commit setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lee1043 committed Nov 3, 2021
1 parent 34cdd56 commit 788f711
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ repos:
rev: v3.4.0
hooks:
- id: trailing-whitespace
exclude: ^(sample_setups/jsons/|tests/deprecated)
- id: end-of-file-fixer
exclude: ^(sample_setups/jsons/|tests/deprecated)
- id: check-yaml
exclude: ^(sample_setups/jsons/|tests/deprecated)

- repo: https://github.com/timothycrosley/isort
rev: 5.9.3
hooks:
- id: isort
exclude: ^(sample_setups/jsons/|tests/deprecated)

# Need to use flake8 GitHub mirror due to CentOS git issue with GitLab
# https://github.com/pre-commit/pre-commit/issues/1206
Expand All @@ -18,10 +27,11 @@ repos:
- id: flake8
args: ["--config=setup.cfg"]
additional_dependencies: [flake8-isort]
exclude: ^sample_setups/jsons/
exclude: ^(sample_setups/jsons/|tests/deprecated)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
args: ["--config=setup.cfg"]
exclude: ^(sample_setups/jsons/|tests/deprecated)
26 changes: 22 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ exclude =
venv
*json

[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88

[pycodestyle]
max-line-length = 119
exclude =
.tox
.git
*/migrations/*
*/static/CACHE/*
docs
node_modules
.idea
.mypy_cache
.pytest_cache
*__init__.py
venv

[mypy]
python_version = 3.8
check_untyped_defs = True
Expand All @@ -32,10 +54,6 @@ 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
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
Expand Down

0 comments on commit 788f711

Please sign in to comment.