Skip to content

Commit

Permalink
added pre commit features (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmalgadey authored Dec 21, 2024
1 parent f42e504 commit 5a9e5d3
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 9 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/lint-and-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install -e '.[all]'
- name: Lint with black
uses: psf/black@stable
Expand All @@ -56,8 +55,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install -e '.[all]'
- name: Run Tests with Coverage
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/report-test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install -e '.[all]'
- name: Run Tests with Coverage
run: |
Expand Down
62 changes: 62 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude: custom_components/econnect_metronet/manifest.json
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
exclude: tests/
args: ["--profile", "black"]

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
exclude: tests/
args: [--line-length=120]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
exclude: tests/
args: [--max-line-length=120 ]

- repo: https://github.com/PyCQA/bandit
rev: '1.8.0'
hooks:
- id: bandit
exclude: tests/

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
hooks:
- id: ruff
exclude: tests/
args: [--line-length=120]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
exclude: tests/
additional_dependencies: [types-requests]
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ classifiers = [
GitHub = "https://github.com/wmalgadey/PyTado"

[project.optional-dependencies]
dev = ["black>=24.3", "pytype", "pylint", "types-requests", "responses", "coverage", "pytest", "pytest-cov"]
dev = ["black>=24.3", "pre-commit", "pytype", "pylint", "types-requests", "requests", "responses", "coverage", "pytest", "pytest-cov"]

all = [
"python-tado[dev]",
]

[project.scripts]
pytado = "pytado.__main__:main"
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

0 comments on commit 5a9e5d3

Please sign in to comment.