From 12f2442ed7aebfb851258b6104ab5987a7f6c13e Mon Sep 17 00:00:00 2001 From: JesperDramsch Date: Mon, 9 Dec 2024 23:00:33 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'.github/wo?= =?UTF-8?q?rkflows/'=20with=20remote=20'workflows/code-quality/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codeql.yml | 25 +++++++++++++++++++++++++ .github/workflows/dependabot.yml | 16 ++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/dependabot.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..30d0c0df7c --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,25 @@ +# .github/workflows/codeql.yml +name: CodeQL Analysis + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + schedule: + - cron: '0 0 * * 0' + +jobs: + analyze: + runs-on: ubuntu-latest + permissions: + security-events: write + + steps: + - uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: python + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000000..9c51924990 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,16 @@ +name: Dependabot PR CI +on: + schedule: + - cron: "0 */6 * * *" # Every six hours + workflow_dispatch: +jobs: + auto-merge: + name: Auto Merge + runs-on: ubuntu-latest + steps: + - name: Merge minor/patch updates + uses: koj-co/dependabot-pr-action@v1 + with: + token: ${{ secrets.GH_PAT }} + merge-minor: true + merge-patch: true From a428436cae1076fa468bdb05b48d5eb79240758b Mon Sep 17 00:00:00 2001 From: JesperDramsch Date: Mon, 9 Dec 2024 23:00:33 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=84=20created=20local=20'.github/d?= =?UTF-8?q?ependabot.yml'=20from=20remote=20'configs/dependabot.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..57535d922f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: +- package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" From 5ef19395ef470eaff01a1ca542a8a86d79840c24 Mon Sep 17 00:00:00 2001 From: JesperDramsch Date: Mon, 9 Dec 2024 23:00:33 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'./'=20with?= =?UTF-8?q?=20remote=20'configs/python/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yml | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .pre-commit-config.yml diff --git a/.pre-commit-config.yml b/.pre-commit-config.yml new file mode 100644 index 0000000000..0cf98ed6e4 --- /dev/null +++ b/.pre-commit-config.yml @@ -0,0 +1,56 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml # Check YAML files for syntax errors + - id: debug-statements # Check for debugger imports and py37+ breakpoint() + - id: end-of-file-fixer # Ensure files end in a newline + - id: trailing-whitespace # Trailing whitespace checker + - id: check-added-large-files # Check for large files added to git + - id: check-merge-conflict # Check for files that contain merge conflict strings +- repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 # Use the ref you want to point at + hooks: + - id: python-use-type-annotations # Check for missing type annotations + - id: python-check-blanket-noqa # Check for # noqa: all + - id: python-no-log-warn # Check for log.warn +- repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: + - -l 120 + - --force-single-line-imports + - --profile black +- repo: https://github.com/asottile/pyupgrade # Upgrade Python syntax + rev: v3.15.2 + hooks: + - id: pyupgrade + args: + - --py310-plus +- repo: https://github.com/psf/black # Format Python code + rev: 24.4.2 + hooks: + - id: black + args: + - --line-length=120 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.4 + hooks: + - id: ruff + args: + - --line-length=120 + - --fix + - --exit-non-zero-on-fix + - --preview +- repo: https://github.com/jshwi/docsig # Check docstrings against function sig + rev: v0.53.2 + hooks: + - id: docsig + args: + - --ignore-no-params # Allow docstrings without parameters + - --check-dunders # Check dunder methods + - --check-overridden # Check overridden methods + - --check-protected # Check protected methods + - --check-class # Check class docstrings + - --disable=E113 # Disable empty docstrings From 46013ea0f75a9bada9a30df1c0aa048c8f0e52ca Mon Sep 17 00:00:00 2001 From: JesperDramsch Date: Mon, 9 Dec 2024 23:00:33 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=84=20created=20local=20'.github/w?= =?UTF-8?q?orkflows/labeler.yml'=20from=20remote=20'workflows/issue-pr/lab?= =?UTF-8?q?eler.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/labeler.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/labeler.yml diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..e57cd86e2b --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 From fe3170b4a0918c92e296d6547d80167d0e4062c9 Mon Sep 17 00:00:00 2001 From: JesperDramsch Date: Mon, 9 Dec 2024 23:00:33 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=84=20created=20local=20'.github/l?= =?UTF-8?q?abeler.yml'=20from=20remote=20'configs/labeler.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/labeler.yml | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..aa9b60f98e --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,63 @@ +Tests: +- changed-files: + - any-glob-to-any-file: [ "tests/**/*" ] + +Dependencies: +- changed-files: + - any-glob-to-any-file: + - "requirements.txt" + - "setup.py" + - "pyproject.toml" + - "poetry.lock" + - "pixi.toml" + - "pixi.lock" + - "Pipfile" + - "Pipfile.lock" + - "requirements/*.txt" + - "requirements/*.in" + +Build: +- changed-files: + - any-glob-to-any-file: + - "Dockerfile*" + - "docker-compose*.yml" + - "Makefile" + +Documentation: +- changed-files: + - any-glob-to-any-file: + - "docs/**/*" + - "*.md" + - "*.rst" + +Config: +- changed-files: + - any-glob-to-any-file: + - ".pre-commit-config.yaml" + - "config/**/*" + - "settings/**/*" + - "*.ini" + - "*.cfg" + - "*.conf" + +CI/CD: +- changed-files: + - any-glob-to-any-file: + - ".github/**/*" + - "tox.ini" + - ".coveragerc" + +# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name +feature: +- head-branch: + - '^feature' + - 'feature' + +# Add 'bugfix' label to branches with bug/fix/hotfix prefixes +bugfix: +- head-branch: [ '^bug', '^fix', '^hotfix' ] + +# Add 'breaking' label for major version bumps or breaking change commits +breaking: +- title: [ '^BREAKING CHANGE', 'BREAKING-CHANGE' ] +- body: [ 'BREAKING CHANGE:', 'BREAKING-CHANGE:' ]