diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 1f6057be..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: trailing-whitespace - exclude: '.*\.md$' - - id: end-of-file-fixer - exclude: '.*\.md$' - - id: check-yaml - - id: check-toml - - id: check-added-large-files - - repo: https://github.com/rhysd/actionlint - rev: v1.7.12 - hooks: - - id: actionlint - additional_dependencies: ['github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1'] - - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 - hooks: - - id: codespell - args: - - --ignore-words-list=hass - additional_dependencies: - - tomli - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.0 - hooks: - - id: mypy - language_version: python3.14 - args: [--config-file=pyproject.toml] - additional_dependencies: - - 'aiohttp' - - 'homeassistant-stubs' - - 'pytest-asyncio' - - 'pytest-cov' - - 'pytest-homeassistant-custom-component' - - 'pytest' - - 'types-cachetools' - - 'types-cffi' - - 'types-greenlet' - - 'types-PyMySQL' - - 'types-pyRFC3339' - - 'types-python-dateutil' - - 'types-PyYAML' - - 'types-requests' - - 'types-setuptools' - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.8 - hooks: - # Run the linter. - - id: ruff-check - args: [--fix] - # Run the formatter. - - id: ruff-format diff --git a/prek.toml b/prek.toml new file mode 100644 index 00000000..08a1dd90 --- /dev/null +++ b/prek.toml @@ -0,0 +1,74 @@ +[[repos]] +repo = "https://github.com/pre-commit/pre-commit-hooks" +rev = "v6.0.0" + +[[repos.hooks]] +id = "trailing-whitespace" +exclude = ".*\\.md$" + +[[repos.hooks]] +id = "end-of-file-fixer" +exclude = ".*\\.md$" + +[[repos.hooks]] +id = "check-yaml" + +[[repos.hooks]] +id = "check-toml" + +[[repos.hooks]] +id = "check-added-large-files" + +[[repos]] +repo = "https://github.com/rhysd/actionlint" +rev = "v1.7.12" + +[[repos.hooks]] +id = "actionlint" +additional_dependencies = ["github.com/wasilibs/go-shellcheck/cmd/shellcheck@v0.11.1"] + +[[repos]] +repo = "https://github.com/codespell-project/codespell" +rev = "v2.4.2" + +[[repos.hooks]] +id = "codespell" +args = ["--ignore-words-list=hass"] +additional_dependencies = ["tomli"] + +[[repos]] +repo = "https://github.com/pre-commit/mirrors-mypy" +rev = "v1.20.0" + +[[repos.hooks]] +id = "mypy" +language_version = "python3.14" +args = ["--config-file=pyproject.toml"] +additional_dependencies = [ + "aiohttp", + "homeassistant-stubs", + "pytest-asyncio", + "pytest-cov", + "pytest-homeassistant-custom-component", + "pytest", + "types-cachetools", + "types-cffi", + "types-greenlet", + "types-PyMySQL", + "types-pyRFC3339", + "types-python-dateutil", + "types-PyYAML", + "types-requests", + "types-setuptools", +] + +[[repos]] +repo = "https://github.com/astral-sh/ruff-pre-commit" +rev = "v0.15.8" + +[[repos.hooks]] +id = "ruff-check" +args = ["--fix"] + +[[repos.hooks]] +id = "ruff-format"