1- # For pre-commit.ci
2- ci :
3- # Defer autoupdate to quarterly (there is no 'off' button) to have renovate pick up first
4- autoupdate_schedule : quarterly
5- skip : [pylint, markdownlint, testing]
6- submodules : true
7-
81default_language_version :
92 # force all unspecified python hooks to run python3
103 python : python3.13
114
125repos :
136 # Run manually in CI skipping the branch checks
14- # RUFF disabled, code is not up to par with HA standards
15- # - repo: https://github.com/astral-sh/ruff-pre-commit
16- # rev: v0.1.7
17- # hooks:
18- # - id: ruff
19- # args:
20- # - --fix
21-
7+ - repo : https://github.com/astral-sh/ruff-pre-commit
8+ rev : v0.11.13
9+ hooks :
10+ - id : ruff
11+ name : " Ruff check"
12+ args :
13+ - --fix
14+ - id : ruff-format
15+ name : " Ruff format"
2216 - repo : https://github.com/pre-commit/pre-commit-hooks
2317 rev : v5.0.0
2418 hooks :
2519 - id : check-executables-have-shebangs
20+ name : " Checking executables"
2621 stages : [manual]
2722 - id : no-commit-to-branch
23+ name : " Verifying branch"
2824 args :
2925 - --branch=main
3026 - repo : https://github.com/asottile/pyupgrade
3127 rev : v3.20.0
3228 hooks :
3329 - id : pyupgrade
30+ name : " Checking pyupgrade"
3431 args : [--py39-plus]
35- # Moved codespell configuration to setup.cfg as per 'all-files' issues not reading args
3632 - repo : https://github.com/codespell-project/codespell
3733 rev : v2.4.1
3834 hooks :
3935 - id : codespell
36+ name : " Check Code Spelling"
37+ args :
38+ - --ignore-words-list=aiport,astroid,checkin,currenty,hass,iif,incomfort,lookin,nam,NotIn # Previous list, remove before merge # - ignore-words-list = additionals,alle,alot,ba,bre,bund,currenty,datas,dof,dur,ether,farenheit,falsy,fo,haa,hass,hist,iam,iff,iif,incomfort,ines,ist,leeg,lightsensor,mut,nam,nd,pres,pullrequests,referer,resset,rime,ser,serie,sur,te,technik,ue,uint,unsecure,visability,wan,wanna,withing,zar
39+ - --skip="./.*,*.csv,*.json,*.ambr"
40+ - --quiet-level=2
4041 exclude_types : [csv, json]
4142 - repo : https://github.com/PyCQA/bandit
4243 rev : 1.8.5
4344 hooks :
4445 - id : bandit
46+ name : " Bandit checking"
4547 args :
4648 - --quiet
4749 - --format=custom
@@ -51,57 +53,73 @@ repos:
5153 rev : v1.37.1
5254 hooks :
5355 - id : yamllint
56+ name : " YAML linting"
5457 - repo : https://github.com/biomejs/pre-commit
5558 rev : v1.9.4
5659 hooks :
5760 - id : biome-lint
58- additional_dependencies :
["@biomejs/[email protected] "] 5961 name : " Verifying/updating code with biome (improved prettier)"
62+ additional_dependencies :
["@biomejs/[email protected] "] 6063 - repo : https://github.com/cdce8p/python-typing-update
6164 rev : v0.7.2
6265 hooks :
6366 # Run `python-typing-update` hook manually from time to time
6467 # to update python typing syntax.
6568 # Will require manual work, before submitting changes!
6669 - id : python-typing-update
70+ name : " Python typing"
6771 stages : [manual]
6872 args :
6973 - --py39-plus
7074 - --force
7175 - --keep-updates
7276 files : ^(plugwise_usb|tests)/.+\.py$
77+ - repo : https://github.com/shellcheck-py/shellcheck-py
78+ rev : v0.10.0.1
79+ hooks :
80+ - id : shellcheck
81+ name : " Shell checking"
82+ args :
83+ - --external-sources
7384 - repo : local
7485 hooks :
7586 # Run mypy through our wrapper script in order to get the possible
7687 # pyenv and/or virtualenv activated; it may not have been e.g. if
7788 # committing from a GUI tool that was not launched from an activated
7889 # shell.
79- - id : userdata
80- name : userdata
81- 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'
8297 language : script
83- types : [python]
84- pass_filenames : false
8598 - id : mypy
86- name : mypy
99+ name : " Running MyPy "
87100 entry : scripts/run-in-env.sh mypy
88101 language : script
89102 types : [python]
90103 require_serial : true
91104 files : ^plugwise_usb/$
92105 - id : pylint
93- name : pylint
106+ name : " PyLinting "
94107 entry : scripts/run-in-env.sh pylint -j 0
95108 language : script
96109 types : [python]
97110 files : ^plugwise_usb/.+\.py$
98111 - id : testing
99- name : " Local Testing - Performing Tests"
112+ name : " Performing Tests"
100113 # yamllint disable-line rule:line-length
101- 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'
102115 language : script
103116 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
104121 - repo : https://github.com/igorshubovych/markdownlint-cli
105122 rev : v0.45.0
106123 hooks :
107124 - id : markdownlint
125+ name : " Markdown linting"
0 commit comments