Skip to content

Commit a09450e

Browse files
committed
Add skip fixtures and rework ordering
1 parent 65740b0 commit a09450e

File tree

10 files changed

+90
-217
lines changed

10 files changed

+90
-217
lines changed

.github/workflows/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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/y tests/y
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/y tests/y
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: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,39 @@ repos:
88
rev: v0.8.2
99
hooks:
1010
- id: ruff
11+
name: "Ruff check"
1112
args:
1213
- --fix
1314
- id: ruff-format
15+
name: "Ruff format"
1416
- repo: https://github.com/pre-commit/pre-commit-hooks
1517
rev: v5.0.0
1618
hooks:
1719
- id: check-executables-have-shebangs
20+
name: "Check scripts"
1821
stages: [manual]
1922
- id: no-commit-to-branch
23+
name: "Check branch"
2024
args:
2125
- --branch=main
2226
- repo: https://github.com/asottile/pyupgrade
2327
rev: v3.19.0
2428
hooks:
2529
- id: pyupgrade
26-
args: [--py39-plus]
30+
name: "Check Py upgrade"
31+
args: [--py311-plus]
2732
# Moved codespell configuration to setup.cfg as per 'all-files' issues not reading args
2833
- repo: https://github.com/codespell-project/codespell
2934
rev: v2.3.0
3035
hooks:
3136
- id: codespell
37+
name: "Check spelling"
3238
exclude_types: [csv, json]
3339
- repo: https://github.com/PyCQA/bandit
3440
rev: 1.8.0
3541
hooks:
3642
- id: bandit
43+
name: "Bandit checking"
3744
args:
3845
- --quiet
3946
- --format=custom
@@ -43,13 +50,15 @@ repos:
4350
rev: v1.35.1
4451
hooks:
4552
- id: yamllint
53+
name: "YAML linting"
4654
- repo: https://github.com/cdce8p/python-typing-update
4755
rev: v0.7.0
4856
hooks:
4957
# Run `python-typing-update` hook manually from time to time
5058
# to update python typing syntax.
5159
# Will require manual work, before submitting changes!
5260
- id: python-typing-update
61+
name: "Python typing"
5362
stages: [manual]
5463
args:
5564
- --py39-plus
@@ -63,41 +72,41 @@ repos:
6372
# committing from a GUI tool that was not launched from an activated
6473
# shell.
6574
- id: setup
66-
name: Setup python
75+
name: "Setup"
6776
entry: /usr/bin/env bash -c 'test -d ./venv || scripts/setup.sh'
6877
language: script
6978
- id: setup_test
70-
name: Setup testing
79+
name: "Setup (extended for testing"
7180
entry: /usr/bin/env bash -c 'test -f ./tmp/biome || scripts/setup_test.sh pre-commit'
7281
language: script
7382
- id: userdata
74-
name: userdata
83+
name: "Validating userdata"
7584
entry: scripts/pre-commit.sh
7685
language: script
7786
types: [python]
7887
pass_filenames: false
7988
- id: mypy
80-
name: mypy
89+
name: "Running MyPy"
8190
entry: scripts/run-in-env.sh mypy
8291
language: script
8392
types: [python]
8493
require_serial: true
8594
files: ^plugwise/$
8695
- id: pylint
87-
name: pylint
96+
name: "PyLinting"
8897
entry: scripts/run-in-env.sh pylint -j 0
8998
language: script
9099
types: [python]
91100
files: ^plugwise/.+\.py$
92101
- id: testing
93-
name: "Local Testing - Performing Tests"
102+
name: "Performing Tests"
94103
# yamllint disable-line rule:line-length
95-
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'
96105
language: script
97106
pass_filenames: false
98107
- id: biome
99-
name: "Local Linting - Biome"
100-
entry: ./tmp/biome check plugwise/ tests/ --files-ignore-unknown=true --no-errors-on-unmatched --indent-width=2 --indent-style=space
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
101110
language: script
102111
- repo: https://github.com/igorshubovych/markdownlint-cli
103112
rev: v0.43.0

fixtures/m_adam_cooling/all_data.json

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@
7373
},
7474
"dev_class": "gateway",
7575
"firmware": "3.7.8",
76-
"gateway_modes": [
77-
"away",
78-
"full",
79-
"vacation"
80-
],
76+
"gateway_modes": ["away", "full", "vacation"],
8177
"hardware": "AME Smile 2.0 board",
8278
"location": "bc93488efab249e5bc54fd7e175a6f91",
8379
"mac_address": "012345679891",
@@ -152,13 +148,7 @@
152148
"dev_class": "climate",
153149
"model": "ThermoZone",
154150
"name": "Living room",
155-
"preset_modes": [
156-
"no_frost",
157-
"asleep",
158-
"vacation",
159-
"home",
160-
"away"
161-
],
151+
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
162152
"select_schedule": "off",
163153
"sensors": {
164154
"electricity_consumed": 149.9,
@@ -172,9 +162,7 @@
172162
"upper_bound": 35.0
173163
},
174164
"thermostats": {
175-
"primary": [
176-
"ad4838d7d35c4d6ea796ee12ae5aedf8"
177-
],
165+
"primary": ["ad4838d7d35c4d6ea796ee12ae5aedf8"],
178166
"secondary": []
179167
},
180168
"vendor": "Plugwise"
@@ -193,13 +181,7 @@
193181
"dev_class": "climate",
194182
"model": "ThermoZone",
195183
"name": "Bathroom",
196-
"preset_modes": [
197-
"no_frost",
198-
"asleep",
199-
"vacation",
200-
"home",
201-
"away"
202-
],
184+
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
203185
"select_schedule": "Badkamer",
204186
"sensors": {
205187
"electricity_consumed": 0.0,
@@ -213,12 +195,8 @@
213195
"upper_bound": 99.9
214196
},
215197
"thermostats": {
216-
"primary": [
217-
"e2f4322d57924fa090fbbc48b3a140dc"
218-
],
219-
"secondary": [
220-
"1772a4ea304041adb83f357b751341ff"
221-
]
198+
"primary": ["e2f4322d57924fa090fbbc48b3a140dc"],
199+
"secondary": ["1772a4ea304041adb83f357b751341ff"]
222200
},
223201
"vendor": "Plugwise"
224202
}

fixtures/m_adam_heating/all_data.json

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,14 @@
7878
},
7979
"dev_class": "gateway",
8080
"firmware": "3.7.8",
81-
"gateway_modes": [
82-
"away",
83-
"full",
84-
"vacation"
85-
],
81+
"gateway_modes": ["away", "full", "vacation"],
8682
"hardware": "AME Smile 2.0 board",
8783
"location": "bc93488efab249e5bc54fd7e175a6f91",
8884
"mac_address": "012345679891",
8985
"model": "Gateway",
9086
"model_id": "smile_open_therm",
9187
"name": "Adam",
92-
"regulation_modes": [
93-
"bleeding_hot",
94-
"bleeding_cold",
95-
"off",
96-
"heating"
97-
],
88+
"regulation_modes": ["bleeding_hot", "bleeding_cold", "off", "heating"],
9889
"select_gateway_mode": "full",
9990
"select_regulation_mode": "heating",
10091
"sensors": {
@@ -156,13 +147,7 @@
156147
"dev_class": "climate",
157148
"model": "ThermoZone",
158149
"name": "Living room",
159-
"preset_modes": [
160-
"no_frost",
161-
"asleep",
162-
"vacation",
163-
"home",
164-
"away"
165-
],
150+
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
166151
"select_schedule": "off",
167152
"sensors": {
168153
"electricity_consumed": 149.9,
@@ -176,9 +161,7 @@
176161
"upper_bound": 35.0
177162
},
178163
"thermostats": {
179-
"primary": [
180-
"ad4838d7d35c4d6ea796ee12ae5aedf8"
181-
],
164+
"primary": ["ad4838d7d35c4d6ea796ee12ae5aedf8"],
182165
"secondary": []
183166
},
184167
"vendor": "Plugwise"
@@ -197,13 +180,7 @@
197180
"dev_class": "climate",
198181
"model": "ThermoZone",
199182
"name": "Bathroom",
200-
"preset_modes": [
201-
"no_frost",
202-
"asleep",
203-
"vacation",
204-
"home",
205-
"away"
206-
],
183+
"preset_modes": ["no_frost", "asleep", "vacation", "home", "away"],
207184
"select_schedule": "Badkamer",
208185
"sensors": {
209186
"electricity_consumed": 0.0,
@@ -217,12 +194,8 @@
217194
"upper_bound": 99.9
218195
},
219196
"thermostats": {
220-
"primary": [
221-
"e2f4322d57924fa090fbbc48b3a140dc"
222-
],
223-
"secondary": [
224-
"1772a4ea304041adb83f357b751341ff"
225-
]
197+
"primary": ["e2f4322d57924fa090fbbc48b3a140dc"],
198+
"secondary": ["1772a4ea304041adb83f357b751341ff"]
226199
},
227200
"vendor": "Plugwise"
228201
}

0 commit comments

Comments
 (0)