From bcfa06ab6a5c022f93104feda9d5a893c2863206 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Sat, 18 May 2024 15:21:53 +0100 Subject: [PATCH 1/2] Sync with latest standards --- .github/workflows/dependabot.yml | 22 ++++++++++++++++++ .pre-commit-config.yaml | 40 +++++++++++++++++++++----------- 2 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..6114ed3 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,22 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ac1b0f..6c9b081 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ -exclude: '^$|venv|.obsidian' +exclude: "^$|venv|.obsidian" repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -11,29 +11,41 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 24.4.2 hooks: - id: black - language_version: python3.10 - - repo: https://github.com/humitos/mirrors-autoflake.git - rev: v1.1 + language_version: python3.12 + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 hooks: - id: autoflake - args: ['--in-place', '--remove-unused-variable'] + args: [--remove-all-unused-imports, --in-place] - repo: https://github.com/PyCQA/isort - rev: 5.11.4 + rev: 5.13.2 hooks: - id: isort - args: ['--line-length=79'] - language_version: python3.10 + args: ["--profile", "black", "--filter-files", "--line-length=79"] + language_version: python3.12 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.10.0 + hooks: + - id: mypy + additional_dependencies: + [ + types-requests, + types-PyYAML, + types-Flask, + types-Werkzeug, + types-Markdown, + ] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.15.2 hooks: - id: pyupgrade args: - - --py37-plus + - --py38-plus - repo: https://github.com/andreoliwa/nitpick - rev: v0.32.0 + rev: v0.35.0 hooks: - id: nitpick - repo: https://github.com/pre-commit/pygrep-hooks @@ -44,3 +56,5 @@ repos: - id: python-no-eval - id: python-no-log-warn - id: rst-backticks +default_language_version: + python: python3.12 From a02762b38e330320e32e1e98a38b7557cc2f1f37 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 15:05:40 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-config.yaml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c9b081..9bf3b64 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,14 +30,8 @@ repos: rev: v1.10.0 hooks: - id: mypy - additional_dependencies: - [ - types-requests, - types-PyYAML, - types-Flask, - types-Werkzeug, - types-Markdown, - ] + additional_dependencies: [types-requests, types-PyYAML, types-Flask, types-Werkzeug, + types-Markdown] - repo: https://github.com/asottile/pyupgrade rev: v3.15.2 hooks: @@ -57,4 +51,4 @@ repos: - id: python-no-log-warn - id: rst-backticks default_language_version: - python: python3.12 + python: python3.11