Skip to content

Commit

Permalink
CI: Add code checks to MR
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWinterstein committed Dec 29, 2024
1 parent 0b2e752 commit a8e7ec8
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 129 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check MR

on: [pull_request]

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pkgxdev/setup@v1
with:
+: task
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Install the project
run: uv sync --all-extras --dev

- name: Run mypy
# For example, using `pytest`
run: uv run mypy
111 changes: 56 additions & 55 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ readme = "README.md"
keywords = ['python']
requires-python = "==3.12.*"
dependencies = [
"paho-mqtt==2.1.0",
"dynaconf",
"tgtg==0.18.1",
"coloredlogs",
"tenacity",
"arrow",
"croniter",
"google-play-scraper",
"random_user_agent",
"packaging",
"freezegun",
"schedule",
"setuptools",
"click==8.1.8",
"paho-mqtt==2.1.0",
"dynaconf",
"tgtg==0.18.1",
"coloredlogs",
"arrow",
"croniter",
"google-play-scraper",
"random_user_agent",
"packaging",
"freezegun",
"schedule",
"click==8.1.8",
]

[project.urls]
Expand All @@ -30,11 +28,12 @@ Documentation = "https://MaxWinterstein.github.io/toogoodtogo-ha-mqtt-bridge/"

[tool.uv]
dev-dependencies = [
"pytest>=7.2.0",
"pre-commit>=2.20.0",
"deptry>=0.20.0",
"mypy>=0.991",
"ruff>=0.6.9",
"pytest>=7.2.0",
"pre-commit>=2.20.0",
"deptry>=0.20.0",
"mypy>=0.991",
"types-croniter",
"ruff>=0.6.9",
]

[build-system]
Expand All @@ -53,6 +52,7 @@ check_untyped_defs = true
warn_return_any = true
warn_unused_ignores = true
show_error_codes = true
ignore_missing_imports = true

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand All @@ -64,44 +64,45 @@ fix = true

[tool.ruff.lint]
select = [
# flake8-2020
"YTT",
# flake8-bandit
"S",
# flake8-bugbear
"B",
# flake8-builtins
"A",
# flake8-comprehensions
"C4",
# flake8-debugger
"T10",
# flake8-simplify
"SIM",
# isort
"I",
# mccabe
"C90",
# pycodestyle
"E", "W",
# pyflakes
"F",
# pygrep-hooks
"PGH",
# pyupgrade
"UP",
# ruff
"RUF",
# tryceratops
"TRY",
# flake8-2020
"YTT",
# flake8-bandit
"S",
# flake8-bugbear
"B",
# flake8-builtins
"A",
# flake8-comprehensions
"C4",
# flake8-debugger
"T10",
# flake8-simplify
"SIM",
# isort
"I",
# mccabe
"C90",
# pycodestyle
"E",
"W",
# pyflakes
"F",
# pygrep-hooks
"PGH",
# pyupgrade
"UP",
# ruff
"RUF",
# tryceratops
"TRY",
]
ignore = [
# LineTooLong
"E501",
# DoNotAssignLambda
"E731",
# i like my unnecessary True if ... else False
"SIM210",
# LineTooLong
"E501",
# DoNotAssignLambda
"E731",
# i like my unnecessary True if ... else False
"SIM210",
]

[tool.ruff.lint.per-file-ignores]
Expand Down
Loading

0 comments on commit a8e7ec8

Please sign in to comment.