Skip to content

Commit 28c9d70

Browse files
committed
Add suggestion
1 parent 181ef6d commit 28c9d70

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 25
7+
CACHE_VERSION: 1
88
DEFAULT_PYTHON: "3.13"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

.pre-commit-config.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,37 @@ repos:
8787
# pyenv and/or virtualenv activated; it may not have been e.g. if
8888
# committing from a GUI tool that was not launched from an activated
8989
# shell.
90-
- id: userdata
91-
name: userdata
92-
entry: scripts/pre-commit.sh
90+
- id: setup
91+
name: "Setup"
92+
entry: /usr/bin/env bash -c 'test -d ./venv || scripts/setup.sh'
93+
language: script
94+
- id: setup_test
95+
name: "Setup (extended for testing"
96+
entry: /usr/bin/env bash -c 'test -f ./tmp/biome || scripts/setup_test.sh pre-commit'
9397
language: script
94-
types: [python]
95-
pass_filenames: false
9698
- id: mypy
97-
name: mypy
99+
name: "Running MyPy"
98100
entry: scripts/run-in-env.sh mypy
99101
language: script
100102
types: [python]
101103
require_serial: true
102104
files: ^plugwise_usb/$
103105
- id: pylint
104-
name: pylint
106+
name: "PyLinting"
105107
entry: scripts/run-in-env.sh pylint -j 0
106108
language: script
107109
types: [python]
108110
files: ^plugwise_usb/.+\.py$
109111
- id: testing
110-
name: "Local Testing - Performing Tests"
112+
name: "Performing Tests"
111113
# yamllint disable-line rule:line-length
112-
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/tests_and_coverage.sh test_and_coverage'
114+
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" NO_FIXTURES="1" scripts/tests_and_coverage.sh test_and_coverage'
113115
language: script
114116
pass_filenames: false
117+
- id: biome
118+
name: "Biome (prettier)"
119+
entry: ./tmp/biome check plugwise_usb/ tests/ --files-ignore-unknown=true --no-errors-on-unmatched --json-formatter-indent-width=2 --json-formatter-indent-style=space
120+
language: script
115121
- repo: https://github.com/igorshubovych/markdownlint-cli
116122
rev: v0.45.0
117123
hooks:

scripts/setup_test.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ uv pip install --upgrade -e . -r requirements_test.txt -c https://raw.githubuser
2525

2626
# Prepare biomejs
2727
echo "Fetching/updating biome cli"
28-
if uname -a | grep -q arm64; then
29-
curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-darwin-arm64" -o "${my_path}/tmp/biome"
30-
elif uname -a | grep -q x86_64; then
31-
curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o "${my_path}/tmp/biome"
32-
else
33-
echo "Unable to determine processor and as such to install packaged biome cli version, bailing out"
34-
exit 2
35-
fi
28+
arch=$(uname -m)
29+
case "$arch" in
30+
aarch64|arm64) url="biome-darwin-arm64" ;;
31+
x86_64) url="biome-linux-x64" ;;
32+
*) echo "Unsupported arch for biome cli version: $arch"; exit 2 ;;
33+
esac
34+
curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-$url" -o "${my_path}/tmp/biome"
3635

3736
# Make biome executable (if necessary)
3837
chmod +x "${my_path}/tmp/biome"

0 commit comments

Comments
 (0)