diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 63484f2..fc28456 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,12 @@ +# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json +--- version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: - interval: "monthly" - open-pull-requests-limit: 1 + interval: monthly + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index b31cd35..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Lint Application -on: - pull_request: - push: - branches: - - main - - test-me-* - workflow_dispatch: - -jobs: - lint_app: - name: ๐Ÿงฝ Lint and Typecheck Application - runs-on: ubuntu-latest - steps: - - name: ๐Ÿ›Ž Checkout - uses: actions/checkout@v4 - - - name: ๐Ÿ Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.11 - cache: pip - - - name: ๐Ÿšง Install Dependencies - run: | - python -m pip install \ - add-trailing-comma \ - autopep8 \ - flake8 \ - mypy \ - pyupgrade \ - reorder-python-imports \ - - - run: python -m autopep8 --exit-code --aggressive --aggressive --in-place $(git ls-files -- '*.py') - - run: python -m flake8 $(git ls-files -- '*.py') - - run: python -m mypy --ignore-missing-imports --scripts-are-modules $(git ls-files -- '*.py') - - run: python -m pyupgrade --py38-plus $(git ls-files -- '*.py') - - run: add-trailing-comma --py36-plus $(git ls-files -- '*.py') - - run: reorder-python-imports --py37-plus $(git ls-files -- '*.py') diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 192a03f..4579619 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -1,5 +1,9 @@ +# yamllint disable rule:line-length +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +# yamllint enable rule:line-length +--- name: Test Application -on: +"on": pull_request: push: branches: @@ -9,25 +13,22 @@ on: jobs: tox: - name: ๐Ÿงช ${{ matrix.env }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - env: ['py38', 'py39', 'py310', 'py311'] + env: ['py38', 'py39', 'py310', 'py311', 'py312'] steps: - - name: ๐Ÿ›Ž Checkout - uses: actions/checkout@v4 - - - name: ๐Ÿ Setup Python - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: | ${{ matrix.env == 'py38' && '3.8' || matrix.env == 'py39' && '3.9' || matrix.env == 'py310' && '3.10' || - '3.11' + matrix.env == 'py311' && '3.11' || + '3.12' }} - run: python -m pip install --upgrade setuptools tox virtualenv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3cd166e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,47 @@ +# yamllint disable rule:line-length +# yaml-language-server: $schema=https://json.schemastore.org/pre-commit-config.json +# yamllint enable rule:line-length +--- +ci: + autoupdate_schedule: quarterly + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + - id: debug-statements + - id: double-quote-string-fixer + - id: end-of-file-fixer + - id: name-tests-test + - id: trailing-whitespace + - repo: https://github.com/asottile/reorder-python-imports + rev: v3.12.0 + hooks: + - id: reorder-python-imports + args: [--py38-plus, --add-import, 'from __future__ import annotations'] + - repo: https://github.com/asottile/add-trailing-comma + rev: v3.1.0 + hooks: + - id: add-trailing-comma + - repo: https://github.com/asottile/pyupgrade + rev: v3.15.0 + hooks: + - id: pyupgrade + args: [--py38-plus] + - repo: https://github.com/hhatto/autopep8 + rev: v2.0.4 + hooks: + - id: autopep8 + - repo: https://github.com/PyCQA/flake8 + rev: 6.1.0 + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.5.1 + hooks: + - id: mypy + - repo: https://github.com/adrienverge/yamllint + rev: v1.32.0 + hooks: + - id: yamllint diff --git a/tests/generate_test.py b/tests/generate_test.py index 899a1a6..d32b1b9 100644 --- a/tests/generate_test.py +++ b/tests/generate_test.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import os import random import string diff --git a/tests/run_test.py b/tests/run_test.py index 42e17d0..5eb9dd3 100644 --- a/tests/run_test.py +++ b/tests/run_test.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import sys from unittest.mock import MagicMock from unittest.mock import patch diff --git a/tests/utils_test.py b/tests/utils_test.py index a293913..d0e0ac6 100644 --- a/tests/utils_test.py +++ b/tests/utils_test.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from unittest.mock import MagicMock from unittest.mock import patch