Skip to content

Commit e73cc2f

Browse files
authored
Merge pull request #20 from stdedos/ci/pre-commit/add-MOAR
See more details in #20
2 parents a5c6855 + c3757aa commit e73cc2f

File tree

8 files changed

+86
-45
lines changed

8 files changed

+86
-45
lines changed

.codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
---
12
ignore:
23
- tests/input/**/*.py

.github/workflows/checks.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Checks
23

34
on:
@@ -11,7 +12,7 @@ on:
1112
env:
1213
CACHE_VERSION: 1
1314
KEY_PREFIX: base-venv
14-
DEFAULT_PYTHON: "3.11"
15+
DEFAULT_PYTHON: '3.11'
1516
PRE_COMMIT_CACHE: ~/.cache/pre-commit
1617

1718
concurrency:
@@ -99,9 +100,7 @@ jobs:
99100
with:
100101
path: venv
101102
fail-on-cache-miss: true
102-
key:
103-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
104-
needs.prepare-base.outputs.python-key }}
103+
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ needs.prepare-base.outputs.python-key }}
105104
- name: Restore pre-commit environment
106105
id: cache-precommit
107106
uses: actions/[email protected]

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Release
23

34
on:
@@ -6,7 +7,7 @@ on:
67
- published
78

89
env:
9-
DEFAULT_PYTHON: "3.11"
10+
DEFAULT_PYTHON: '3.11'
1011

1112
permissions:
1213
contents: read

.github/workflows/run-tests.yaml

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Testing
23

34
on:
@@ -39,40 +40,41 @@ jobs:
3940
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || '/bin/bash --noprofile --norc -Eeuxo pipefail {0}' }}
4041

4142
steps:
42-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v3
4344

44-
- name: Slugify GITHUB_REPOSITORY
45-
run: echo "GITHUB_REPOSITORY_SLUG=${GITHUB_REPOSITORY////_}" >> $GITHUB_ENV
45+
- name: Slugify GITHUB_REPOSITORY
46+
run: echo "GITHUB_REPOSITORY_SLUG=${GITHUB_REPOSITORY////_}" >> $GITHUB_ENV
4647

47-
- name: Set up Python ${{ matrix.python-version }}
48-
uses: actions/setup-python@v4
49-
with:
50-
python-version: ${{ matrix.python-version }}
51-
cache: 'pip'
52-
cache-dependency-path: setup.py
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
cache: pip
53+
cache-dependency-path: setup.py
5354

54-
- name: Install dependencies
55-
run: |
56-
python -m pip install --upgrade pip
57-
python -m pip install tox
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
python -m pip install tox
5859
59-
- name: Test with tox
60-
env:
61-
FORCE_COLOR: 1
62-
PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes
63-
run: tox ${{ matrix.python-version == '3.6' && '--skip-missing-interpreters=true' || '' }}
60+
- name: Test with tox
61+
env:
62+
FORCE_COLOR: 1
63+
PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes
64+
run: tox ${{ matrix.python-version == '3.6' && '--skip-missing-interpreters=true' || '' }}
6465

65-
- name: Upload coverage reports to Codecov
66-
uses: codecov/codecov-action@v3
67-
with:
68-
token: ${{ secrets.CODECOV_TOKEN }}
69-
flags: ${{ matrix.os }},${{ matrix.python-version }}
70-
fail_ci_if_error: true
71-
files: test_artifacts/cobertura.xml
66+
- name: Upload coverage reports to Codecov
67+
uses: codecov/codecov-action@v3
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
flags: ${{ matrix.os }},${{ matrix.python-version }}
71+
fail_ci_if_error: true
72+
files: test_artifacts/cobertura.xml
7273

73-
- name: Create artifacts
74-
uses: actions/upload-artifact@v3
75-
if: ${{ !cancelled() }}
76-
with:
77-
name: ${{ env.GITHUB_REPOSITORY_SLUG }}_test-artifacts_${{ github.event_name }}_${{ github.event.pull_request.number || github.sha }}_${{ matrix.os }}_py${{ matrix.python-version }}
78-
path: test_artifacts/
74+
- name: Create artifacts
75+
uses: actions/upload-artifact@v3
76+
if: ${{ !cancelled() }}
77+
with:
78+
name: ${{ env.GITHUB_REPOSITORY_SLUG }}_test-artifacts_${{ github.event_name }}_${{ github.event.pull_request.number || github.sha }}_${{ matrix.os
79+
}}_py${{ matrix.python-version }}
80+
path: test_artifacts/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
sandbox/**/*.py
22
/test_artifacts/
33

4+
# ruff Python linter
5+
.ruff_cache/
6+
47
## Mostly complete version from https://github.com/github/gitignore/blob/e5323759e387ba347a9d50f8b0ddd16502eb71d4/Python.gitignore
58

69
# Byte-compiled / optimized / DLL files

.pre-commit-config.yaml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
ci:
23
skip: [pylint]
34

@@ -9,14 +10,37 @@ repos:
910
exclude: ^.idea/
1011
- id: trailing-whitespace
1112
- id: pretty-format-json
12-
args: [ "--no-sort-keys", "--autofix", "--indent=4" ]
1313
exclude: ^.vscode/
14+
args:
15+
- --autofix
16+
- --no-sort-keys
17+
- --indent=4
18+
- id: check-yaml
19+
- id: check-toml
20+
- id: check-vcs-permalinks
21+
- id: check-shebang-scripts-are-executable
22+
- id: name-tests-test
23+
exclude: ^tests/(input/|base_tester(|_test).py$)
24+
args:
25+
- --pytest-test-first
26+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
27+
rev: 0.2.1
28+
hooks:
29+
- id: yamlfmt
30+
args:
31+
- --mapping
32+
- '2'
33+
- --sequence
34+
- '4'
35+
- --offset
36+
- '2'
1437
- repo: https://github.com/astral-sh/ruff-pre-commit
1538
rev: v0.0.292
1639
hooks:
1740
- id: ruff
18-
args: ["--fix"]
19-
exclude: "tests/input/"
41+
args:
42+
- --fix
43+
exclude: tests/input/
2044
- repo: https://github.com/psf/black
2145
rev: 23.9.1
2246
hooks:
@@ -41,16 +65,26 @@ repos:
4165
- id: rst-directive-colons
4266
- id: rst-inline-touching-normal
4367
- id: text-unicode-replacement-char
68+
- repo: local
69+
hooks:
70+
- id: python-no-log-fatal
71+
name: avoid logger.fatal(
72+
description: A quick check for the deprecated `.fatal()` method of python loggers
73+
entry: (?<!warnings)\.fatal\(
74+
language: pygrep
75+
types: [python]
4476
- repo: https://github.com/pre-commit/mirrors-mypy
4577
rev: v1.6.0
4678
hooks:
47-
- id: mypy
48-
exclude: "tests/input/"
79+
- id: mypy
80+
exclude: tests/input/
4981
- repo: local
5082
hooks:
5183
- id: pylint
5284
name: pylint
5385
entry: bash -c 'test -d .venv && . .venv/bin/activate ; pylint "$@"' -
5486
language: system
55-
types: [ python ]
56-
args: ["-sn", "-rn"]
87+
types: [python]
88+
args:
89+
- -sn
90+
- -rn

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
[![codecov](https://codecov.io/gh/pylint-dev/pylint-pytest/graph/badge.svg?token=NhZDLKmomd)](https://codecov.io/gh/pylint-dev/pylint-pytest)
1010

1111
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
12-
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1312
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
13+
[![Pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)
14+
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
1415

1516
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/stdedos)
1617

@@ -37,7 +38,7 @@ Enable via command line option `--load-plugins`
3738
$ pylint --load-plugins pylint_pytest <path_to_your_sources>
3839
```
3940

40-
Or in `pylintrc`:
41+
Or in `.pylintrc`:
4142

4243
```ini
4344
[MASTER]

setup.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)