Skip to content

Commit 978fc32

Browse files
authored
Merge pull request #664 from plugwise/tooling
Rework tooling
2 parents 346339a + 40f5e17 commit 978fc32

File tree

80 files changed

+929
-1718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+929
-1718
lines changed

.github/workflows/verify.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 11
7+
CACHE_VERSION: 12
88
DEFAULT_PYTHON: "3.13.0"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

@@ -98,12 +98,12 @@ jobs:
9898
- name: Ruff (with fix)
9999
run: |
100100
. venv/bin/activate
101-
ruff check --fix plugwise/*py tests/*py
101+
ruff check plugwise/ tests/
102102
- name: If needed, commit ruff changes to the pull request
103103
if: failure()
104104
run: |
105105
. venv/bin/activate
106-
ruff check --fix plugwise/*py tests/*py
106+
ruff format plugwise/ tests/
107107
git config --global user.name 'autoruff'
108108
git config --global user.email '[email protected]'
109109
git remote set-url origin https://x-access-token:${{ secrets.PAT_CT }}@github.com/$GITHUB_REPOSITORY

.pre-commit-config.yaml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
ci:
2-
# Defer autoupdate to quarterly (there is no 'off' button) to have renovate pick up first
3-
autoupdate_schedule: quarterly
4-
skip: [setup, setup_test, pylint, markdownlint, testing, biome]
5-
submodules: true
6-
71
default_language_version:
82
# force all unspecified python hooks to run python3
93
python: python3.13
@@ -14,31 +8,39 @@ repos:
148
rev: v0.8.2
159
hooks:
1610
- id: ruff
11+
name: "Ruff check"
1712
args:
1813
- --fix
14+
- id: ruff-format
15+
name: "Ruff format"
1916
- repo: https://github.com/pre-commit/pre-commit-hooks
2017
rev: v5.0.0
2118
hooks:
2219
- id: check-executables-have-shebangs
20+
name: "Check scripts"
2321
stages: [manual]
2422
- id: no-commit-to-branch
23+
name: "Check branch"
2524
args:
2625
- --branch=main
2726
- repo: https://github.com/asottile/pyupgrade
2827
rev: v3.19.0
2928
hooks:
3029
- id: pyupgrade
31-
args: [--py39-plus]
30+
name: "Check Py upgrade"
31+
args: [--py311-plus]
3232
# Moved codespell configuration to setup.cfg as per 'all-files' issues not reading args
3333
- repo: https://github.com/codespell-project/codespell
3434
rev: v2.3.0
3535
hooks:
3636
- id: codespell
37+
name: "Check spelling"
3738
exclude_types: [csv, json]
3839
- repo: https://github.com/PyCQA/bandit
3940
rev: 1.8.0
4041
hooks:
4142
- id: bandit
43+
name: "Bandit checking"
4244
args:
4345
- --quiet
4446
- --format=custom
@@ -48,13 +50,15 @@ repos:
4850
rev: v1.35.1
4951
hooks:
5052
- id: yamllint
53+
name: "YAML linting"
5154
- repo: https://github.com/cdce8p/python-typing-update
5255
rev: v0.7.0
5356
hooks:
5457
# Run `python-typing-update` hook manually from time to time
5558
# to update python typing syntax.
5659
# Will require manual work, before submitting changes!
5760
- id: python-typing-update
61+
name: "Python typing"
5862
stages: [manual]
5963
args:
6064
- --py39-plus
@@ -68,41 +72,41 @@ repos:
6872
# committing from a GUI tool that was not launched from an activated
6973
# shell.
7074
- id: setup
71-
name: Setup python
75+
name: "Setup"
7276
entry: /usr/bin/env bash -c 'test -d ./venv || scripts/setup.sh'
7377
language: script
7478
- id: setup_test
75-
name: Setup testing
79+
name: "Setup (extended for testing"
7680
entry: /usr/bin/env bash -c 'test -f ./tmp/biome || scripts/setup_test.sh pre-commit'
7781
language: script
7882
- id: userdata
79-
name: userdata
83+
name: "Validating userdata"
8084
entry: scripts/pre-commit.sh
8185
language: script
8286
types: [python]
8387
pass_filenames: false
8488
- id: mypy
85-
name: mypy
89+
name: "Running MyPy"
8690
entry: scripts/run-in-env.sh mypy
8791
language: script
8892
types: [python]
8993
require_serial: true
9094
files: ^plugwise/$
9195
- id: pylint
92-
name: pylint
96+
name: "PyLinting"
9397
entry: scripts/run-in-env.sh pylint -j 0
9498
language: script
9599
types: [python]
96100
files: ^plugwise/.+\.py$
97101
- id: testing
98-
name: "Local Testing - Performing Tests"
102+
name: "Performing Tests"
99103
# yamllint disable-line rule:line-length
100-
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/tests_and_coverage.sh test_and_coverage'
104+
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" NO_FIXTURES="1" scripts/tests_and_coverage.sh test_and_coverage'
101105
language: script
102106
pass_filenames: false
103107
- id: biome
104-
name: "Local Linting - Biome"
105-
entry: ./tmp/biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched
108+
name: "Biome (prettier)"
109+
entry: ./tmp/biome check fixtures/ plugwise/ tests/ --files-ignore-unknown=true --no-errors-on-unmatched --json-formatter-indent-width=2 --json-formatter-indent-style=space
106110
language: script
107111
- repo: https://github.com/igorshubovych/markdownlint-cli
108112
rev: v0.43.0

0 commit comments

Comments
 (0)