Skip to content

Commit

Permalink
add tests for WS90 rain state detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dkadioglu committed Oct 6, 2024
1 parent b95d06b commit 9ba110a
Show file tree
Hide file tree
Showing 3 changed files with 476 additions and 75 deletions.
153 changes: 78 additions & 75 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,150 +4,153 @@ repos:
hooks:
- id: blacken-docs
name: ☕️ Format documentation using black
language: system
language: python
files: '\.(rst|md|markdown|py|tex)$'
entry: poetry run blacken-docs
require_serial: true
- id: codespell
name: ✅ Checking code for misspellings
language: python
types: [text]
exclude: ^poetry\.lock$
entry: poetry run codespell -L HASS,hass
- id: format
name: ☕️ Formatting code using ruff
language: python
types: [python]
entry: poetry run ruff format
- id: isort
name: 🔀 Sorting all imports with isort
language: python
types: [python]
entry: poetry run isort
- id: mypy
name: 🆎 Performing static type checking using mypy
language: python
types: [python]
entry: poetry run mypy
exclude: ^vulture_whitelist\.py$
require_serial: true
- id: poetry
name: 📜 Checking pyproject with Poetry
language: python
entry: poetry check
pass_filenames: false
always_run: true
- id: pylint
name: 🌟 Starring code with pylint
language: python
types: [python]
entry: poetry run pylint
exclude: ^vulture_whitelist\.py$
- id: pyupgrade
name: 🆙 Checking for upgradable syntax with pyupgrade
language: python
types: [python]
entry: poetry run pyupgrade
args: [--py39-plus, --keep-runtime-typing]
- id: ruff
name: 👔 Enforcing style guide with ruff
language: python
types: [python]
entry: poetry run ruff check --fix
exclude: ^vulture_whitelist\.py$
- id: vulture
name: 🔍 Finding unused Python code with Vulture
language: python
types: [python]
entry: poetry run vulture ecowitt2mqtt tests vulture_whitelist.py
pass_filenames: false
require_serial: true
- id: yamllint
name: 🎗 Checking YAML files with yamllint
language: python
types: [yaml]
entry: poetry run yamllint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
name: 🐍 Checking Python AST
language: system
language: python
types: [python]
entry: poetry run check-ast
- id: check-case-conflict
name: 🔠 Checking for case conflicts
language: system
language: python
entry: poetry run check-case-conflict
- id: check-docstring-first
name: ℹ️ Checking docstrings are first
language: system
language: python
types: [python]
entry: poetry run check-docstring-first
- id: check-executables-have-shebangs
name: 🧐 Checking that executables have shebangs
language: system
language: python
types: [text, executable]
entry: poetry run check-executables-have-shebangs
stages: [commit, push, manual]
- id: check-json
name: { Checking JSON files
language: system
language: python
types: [json]
entry: poetry run check-json
- id: check-merge-conflict
name: 💥 Checking for merge conflicts
language: system
language: python
types: [text]
entry: poetry run check-merge-conflict
- id: check-symlinks
name: 🔗 Checking for broken symlinks
language: system
language: python
types: [symlink]
entry: poetry run check-symlinks
- id: check-toml
name: ✅ Checking TOML files
language: system
language: python
types: [toml]
entry: poetry run check-toml
- id: check-yaml
name: ✅ Checking YAML files
language: system
language: python
types: [yaml]
entry: poetry run check-yaml
- id: codespell
name: ✅ Checking code for misspellings
language: system
types: [text]
exclude: ^poetry\.lock$
entry: poetry run codespell -L HASS,hass
- id: debug-statements
name: 🪵 Checking for debug statements and imports (Python)
language: system
language: python
types: [python]
entry: poetry run debug-statement-hook
- id: detect-private-key
name: 🕵️ Detecting private keys
language: system
language: python
types: [text]
entry: poetry run detect-private-key
- id: end-of-file-fixer
name: 🔚 Checking end of files
language: system
language: python
types: [text]
entry: poetry run end-of-file-fixer
stages: [commit, push, manual]
- id: fix-byte-order-marker
name: 🚏 Checking UTF-8 byte order marker
language: system
language: python
types: [text]
entry: poetry run fix-byte-order-marker
- id: format
name: ☕️ Formatting code using ruff
language: system
types: [python]
entry: poetry run ruff format
- id: isort
name: 🔀 Sorting all imports with isort
language: system
types: [python]
entry: poetry run isort
- id: mypy
name: 🆎 Performing static type checking using mypy
language: system
types: [python]
entry: poetry run mypy
exclude: ^vulture_whitelist\.py$
require_serial: true
- id: no-commit-to-branch
name: 🛑 Checking for commit to protected branch
language: system
language: python
entry: poetry run no-commit-to-branch
pass_filenames: false
always_run: true
args:
- --branch=dev
- --branch=main
- id: poetry
name: 📜 Checking pyproject with Poetry
language: system
entry: poetry check
pass_filenames: false
always_run: true
- id: pylint
name: 🌟 Starring code with pylint
language: system
types: [python]
entry: poetry run pylint
exclude: ^vulture_whitelist\.py$
- id: pyupgrade
name: 🆙 Checking for upgradable syntax with pyupgrade
language: system
types: [python]
entry: poetry run pyupgrade
args: [--py39-plus, --keep-runtime-typing]
- id: ruff
name: 👔 Enforcing style guide with ruff
language: system
types: [python]
entry: poetry run ruff check --fix
exclude: ^vulture_whitelist\.py$
- id: trailing-whitespace
name: ✄ Trimming trailing whitespace
language: system
language: python
types: [text]
entry: poetry run trailing-whitespace-fixer
stages: [commit, push, manual]
- id: vulture
name: 🔍 Finding unused Python code with Vulture
language: system
types: [python]
entry: poetry run vulture ecowitt2mqtt tests vulture_whitelist.py
pass_filenames: false
require_serial: true
- id: yamllint
name: 🎗 Checking YAML files with yamllint
language: system
types: [yaml]
entry: poetry run yamllint

- repo: https://github.com/AleksaC/hadolint-py
rev: v2.12.0.3
Expand Down
Loading

0 comments on commit 9ba110a

Please sign in to comment.