Skip to content

Commit 26bf28a

Browse files
authored
Merge pull request #991 from PCMDI/lee1043-patch-1
Update .pre-commit-config.yaml
2 parents af4ceab + 1401dc2 commit 26bf28a

File tree

4 files changed

+26
-44
lines changed

4 files changed

+26
-44
lines changed

.github/workflows/build_workflow.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99

1010
workflow_dispatch:
1111

12+
env:
13+
CANCEL_OTHERS: true
14+
PATHS_IGNORE: '["**/README.rst", "**/docs/**", "**/ISSUE_TEMPLATE/**", "**/pull_request_template.md", "**/.vscode/**"]'
15+
1216
jobs:
1317
check-jobs-to-skip:
1418
runs-on: ubuntu-latest
@@ -27,25 +31,16 @@ jobs:
2731
runs-on: ubuntu-latest
2832
timeout-minutes: 10
2933
steps:
30-
- uses: actions/setup-node@v3
31-
with:
32-
node-version: '16'
3334
- name: Checkout Code Repository
3435
uses: actions/checkout@v3
35-
with:
36-
node-version: '16'
36+
3737
- name: Set up Python
3838
uses: actions/setup-python@v4
3939
with:
40-
node-version: '16'
4140
python-version: '3.10'
42-
# Run all pre-commit hooks on all the files.
43-
# Getting only staged files can be tricky in case a new PR is opened
44-
# since the action is run on a branch in detached head state
41+
4542
- name: Install and Run Pre-commit
4643
uses: pre-commit/action@v3.0.0
47-
with:
48-
node-version: '16'
4944

5045
build:
5146
needs: check-jobs-to-skip
@@ -56,9 +51,6 @@ jobs:
5651
shell: bash -l {0}
5752
timeout-minutes: 10
5853
steps:
59-
- uses: actions/setup-node@v3
60-
with:
61-
node-version: '16'
6254
- uses: actions/checkout@v3
6355

6456
- name: Set up Conda Environment
@@ -82,7 +74,6 @@ jobs:
8274
- name: Cache Conda
8375
uses: actions/cache@v3
8476
with:
85-
node-version: '16'
8677
path: ${{ env.CONDA }}/envs
8778
key:
8879
conda-${{ runner.os }}--${{ runner.arch }}--${{

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration file for `pre-commit` tool.
22
# Source: https://pre-commit.com/#pre-commit-configyaml---top-level
3-
exclude: "docs|node_modules|migrations|.git|.tox|.md|sample_setups/(external-setups|jsons)|tests/deprecated"
3+
exclude: "docs|node_modules|migrations|.git|.tox|README.md|sample_setups/(external-setups|jsons)|tests/deprecated"
44
default_stages: [commit]
55
fail_fast: true
66

@@ -20,16 +20,15 @@ repos:
2020
# Python code formatters
2121
# =======================
2222
- repo: https://github.com/psf/black
23-
rev: 23.1.0
23+
rev: 23.3.0
2424
hooks:
2525
- id: black
2626

27-
- repo: https://github.com/PyCQA/isort
27+
- repo: https://github.com/timothycrosley/isort
2828
rev: 5.12.0
2929
hooks:
3030
- id: isort
3131

32-
3332
# =======================
3433
# Python linting
3534
# =======================

pyproject.toml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 88
3-
target-version = ['py36']
3+
target-version = ['py39']
44
include = '\.pyi?$'
55
exclude = '''
66
(
@@ -21,3 +21,18 @@ exclude = '''
2121
)/
2222
)
2323
'''
24+
25+
[tool.isort]
26+
# Docs: https://pycqa.github.io/isort/docs/configuration/options.html#example-pyprojecttoml_4
27+
multi_line_output = 3
28+
include_trailing_comma = true
29+
force_grid_wrap = 0
30+
use_parentheses = true
31+
line_length = 88
32+
33+
[tool.pytest.ini_options]
34+
# Docs: https://docs.pytest.org/en/7.2.x/reference/customize.html#configuration
35+
junit_family = "xunit2"
36+
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"
37+
python_files = ["tests.py", "test_*.py"]
38+

setup.cfg

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[flake8]
22
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
3+
# flake8 dooes not support pyproject.toml yet: https://github.com/PyCQA/flake8/issues/234
34
ignore =
45
# whitespace before ‘:’
56
E203
@@ -31,31 +32,7 @@ exclude =
3132
*json
3233
*md
3334

34-
[isort]
35-
multi_line_output=3
36-
include_trailing_comma=True
37-
force_grid_wrap=0
38-
use_parentheses=True
39-
line_length=88
4035

41-
[pycodestyle]
42-
max-line-length = 119
43-
exclude =
44-
.tox
45-
.git
46-
*/migrations/*
47-
*/static/CACHE/*
48-
docs
49-
node_modules
50-
.idea
51-
.mypy_cache
52-
.pytest_cache
53-
*__init__.py
54-
venv
55-
56-
[aliases]
57-
# Define setup.py command aliases here
58-
test = pytest
5936

6037
[tool:pytest]
6138
junit_family = xunit2

0 commit comments

Comments
 (0)