diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..a701a0b --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,24 @@ +name: pre-commit + +on: + pull_request: + branches: ["main"] + push: + branches: ["main"] + +jobs: + pre-commit: + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v2 + with: + python-version: "3.12" + - run: | + pip install pre-commit + pip install pyright + pip install -r requirements.txt + pre-commit run --all-files + env: + SKIP: update-pyi-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 810b770..7066642 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,9 @@ repos: - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + args: [custom_components, "*_demo"] + diff --git a/pyproject.toml b/pyproject.toml index 7380134..98b43c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,4 +41,3 @@ include = ["custom_components/**/*.py", "ag_grid_demo/**/*.py"] "__init__.py" = ["F401"] "env.py" = ["ALL"] "*/alembic/*" = ["ALL"] -# "tests/*.py" = ["D100", "D103", "D104", "B018","ERA", "PERF", "T", "N"] \ No newline at end of file