Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/core_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ name: Validate plugwise-beta against HA-core dev

env:
# Uses a different key/restore key than test.yml
CACHE_VERSION: 2
CACHE_VERSION: 3
DEFAULT_PYTHON: "3.13"
PRE_COMMIT_HOME: ~/.cache/pre-commit
VENV: venv

on:
Expand Down Expand Up @@ -49,15 +48,14 @@ jobs:
needs: cache
name: Prepare
steps:
- name: Prepare code checkout and python/pre-commit setup
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v1
uses: plugwise/gh-actions/prepare-python-and-code@v2
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
clone-core: "true"
- name: Test against HA-core DEV (for active or upcoming RC/Beta)
run: |
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
name: Test PR against HA-core

env:
CACHE_VERSION: 1
CACHE_VERSION: 3
DEFAULT_PYTHON: "3.13"
PRE_COMMIT_HOME: ~/.cache/pre-commit
VENV: venv

# Do not run on 'push' (as the flow doesn't have access to the labels) - also disabled workflow_dispatch as such
Expand Down Expand Up @@ -83,40 +82,39 @@ jobs:
needs: cache
name: Prepare
steps:
- name: Prepare code checkout and python/pre-commit setup
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v1
uses: plugwise/gh-actions/prepare-python-and-code@v2
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
precommit-home: ${{ env.PRE_COMMIT_HOME }}
clone-core: "true"

# Prepare default python version environment
ha-core-release-prepare:
runs-on: ubuntu-latest
name: Prepare and validate pre-commit
name: Prepare and validate prek (pre-commit)
needs:
- cache
- prepare
steps:
- name: Check out committed code
uses: actions/checkout@v6
- name: Prepare code checkout and python/pre-commit setup
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v1
uses: plugwise/gh-actions/prepare-python-and-code@v2
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
python-version: ${{ needs.cache.outputs.python-version }}
venv-dir: ${{ env.VENV }}
- name: Run all-files pre-commit excluding testing
- name: Run all-files prek (pre-commit) excluding testing
run: |
# shellcheck disable=SC1091 # ingesting virtualenv
source venv-${{ needs.cache.outputs.python-version }}/bin/activate
pre-commit run --all-files --show-diff-on-failure
prek run --all-files --show-diff-on-failure
env: # While not problematic, save time on performing the local hooks as they are run from the complete script in the next job
SKIP: local-test-core-prep,local-test-pip-prep,local-testing,local-quality

Expand All @@ -135,9 +133,9 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v6.0.1
- name: Prepare code checkout and python/pre-commit setup
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v1
uses: plugwise/gh-actions/prepare-python-and-code@v2
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
Expand Down Expand Up @@ -176,9 +174,9 @@ jobs:
steps:
- name: Check out committed code
uses: actions/checkout@v6.0.1
- name: Prepare code checkout and python/pre-commit setup
- name: Prepare code checkout and python/prek/pre-commit setup
id: cache-reuse
uses: plugwise/gh-actions/prepare-python-and-code@v1
uses: plugwise/gh-actions/prepare-python-and-code@v2
with:
cache-key: ${{ needs.cache.outputs.cache-key }}
fail-on-miss: false # First time create cache (if not already exists)
Expand Down
2 changes: 0 additions & 2 deletions .markdownlint.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ repos:
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" BRANCH="${BRANCH:-}" scripts/core-testing.sh quality'
language: script
pass_filenames: false
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.47.0
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.34
hooks:
- id: markdownlint
name: "Linting Markdown"
- id: pymarkdown
name: MarkDown Lint
1 change: 1 addition & 0 deletions .pymarkdown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "plugins": { "md013": { "enabled": false } } }
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Versions from 0.40 and up
## Ongoing

- Implement Core PR [#159626](https://github.com/home-assistant/core/pull/159626) via PR [#994](https://github.com/plugwise/plugwise-beta/pull/994)
- Chores
- Introduce prek (for pre-commit) & align with v2 gh-actions
- Replace node-based markdownlint with pythonic library

## v0.62.2

Expand Down
1 change: 1 addition & 0 deletions requirements_commit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prek>=0.2.27
14 changes: 8 additions & 6 deletions scripts/core-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ venv_and_uv() {
echo -e "${CINFO}Ensure uv presence${CWARN}"
python3 -m pip install uv
fi
if ! [ -x "$(command -v prek)" ]; then
echo -e "${CINFO}Ensure prek presence${CWARN}"
uv pip install -r "${my_path}/requirements_commit.txt"
fi
if ! uv pip list | grep -q bcrypt; then
script/setup
fi
Expand Down Expand Up @@ -95,10 +99,8 @@ fi
# /20250613

# Install commit requirements
uv pip install --upgrade pre-commit

# Install pre-commit hook
pre-commit install
uv pip install -r "${my_path}/requirements_commit.txt"
prek install

# i.e. args used for functions, not directions
set +u
Expand Down Expand Up @@ -276,8 +278,8 @@ if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "quality" ] ; then
echo -e "${CINFO}... mypy ...${CNORM}"
script/run-in-env.sh mypy homeassistant/components/${REPO_NAME}/*.py || exit
cd ..
echo -e "${CINFO}... markdownlint ...${CNORM}"
pre-commit run --all-files --hook-stage manual markdownlint
echo -e "${CINFO}... pymarkdown ...${CNORM}"
prek run --all-files --hook-stage manual pymarkdown
fi # quality

# Copying back not necessary in actions
Expand Down
Loading