Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#32)
Browse files Browse the repository at this point in the history
* DX: lint PRs with shared commitlint config
* DX: merge `setup.cfg` into `pyproject.toml`
* DX: remove `.prettierrc`
* DX: remove GitHub Issue templates
* DX: synchronize ComPWA dev environment

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2023
1 parent 5121e00 commit dcd6f81
Show file tree
Hide file tree
Showing 27 changed files with 126 additions and 193 deletions.
29 changes: 1 addition & 28 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,13 @@
],
"ignorePaths": [
"**/.cspell.json",
"*.bib",
"*.ico",
"*.root",
"*.rst_t",
"*.svg",
"*particle*.*ml",
".constraints/*.txt",
".editorconfig",
".gitignore",
".gitpod.*",
".mypy.ini",
".pre-commit-config.yaml",
".prettierignore",
".readthedocs.yml",
".vscode/*",
".vscode/.gitignore",
".zenodo.json",
"codecov.yml",
"Dockerfile",
"docs/_templates/*",
"docs/adr/*/*",
"docs/conf.py",
"labels.toml",
"Makefile",
"Manifest.toml",
"Project.toml",
"pyproject.toml",
"pyrightconfig.json",
"pytest.ini",
"requirements*.txt",
"setup.cfg",
"setup.py",
"tox.ini",
"typings"
"pyproject.toml"
],
"ignoreWords": ["mhutchie", "noqa", "noreply", "taplo"],
"language": "en-US",
Expand Down
32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

11 changes: 0 additions & 11 deletions .github/pull_request_template.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Configure Git credentials
run: |
git config --global user.name "GitHub Action"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docnb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Execute and build documentation
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Check external links
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ on:
jobs:
check-labels:
name: Check labels
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest
- uses: docker://agilepathway/pull-request-label-checker:latest # cspell:ignore agilepathway
with:
any_of: 🐛 Bug,✨ Feature,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX
any_of: >-
🐛 Bug,✨ Feature,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX
none_of: Epic,💫 Good first issue
repo_token: ${{ secrets.GITHUB_TOKEN }}

check-title:
name: Check title
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: npm install @commitlint/config-conventional
- uses: JulienKode/[email protected]
# cspell:ignore kode
- uses: actions/checkout@v4
- run: npm install @compwa/commitlint-config
- name: Create commitlint config
run: |
echo "module.exports = {extends: ['@compwa/commitlint-config']}" > commitlint.config.js
- uses: JulienKode/[email protected] # cspell:ignore kode
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
needs: determine-hooks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
needs: determine-hooks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git config --global --add safe.directory $(pwd)
- env:
PRE_COMMIT_HOME: /root/.cache/pre-commit
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
- taplo
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.token || secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-to-version-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Configure Git credentials
run: |
git config --global user.name "GitHub Action"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fail-fast: false
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Determine extras to install
run: |
if [[ -z '${{ inputs.additional-extras }}' ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
update_release_draft:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: release-drafter/release-drafter@v5
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/update-pip-constraints@main
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -48,7 +48,7 @@ jobs:
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ComPWA/update-pre-commit@main

push:
Expand All @@ -58,7 +58,7 @@ jobs:
- pip-constraints
- pre-commit
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.token }}
- uses: actions/download-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vscode:
- github.vscode-github-actions
- github.vscode-pull-request-github
- mhutchie.git-graph
- ms-python.black-formatter
- ms-python.python
- redhat.vscode-yaml
- stkb.rewrap
Expand Down
36 changes: 22 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand All @@ -23,25 +23,26 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.0.192
rev: 0.1.0
hooks:
- id: check-dev-files
args:
- --allow-deprecated-workflows
- --no-notebooks
- --no-prettierrc
- --no-pypi
- --no-version-branches
- --repo-name=actions
- --repo-title=ComPWA actions and shared workflows
- id: format-setup-cfg

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.31.0
rev: v7.3.1
hooks:
- id: cspell

Expand All @@ -57,30 +58,37 @@ repos:
)$
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
rev: v3.0.3
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.316
rev: v1.1.330
hooks:
- id: pyright

- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py37-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
rev: v0.0.292
hooks:
- id: ruff
args:
- --fix

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.0
rev: v0.8.1
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

10 changes: 3 additions & 7 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
exclude = [
"**/Cargo.toml",
"**/Manifest.toml",
"**/Project.toml",
"labels*.toml",
]

[formatting]
align_comments = false
align_entries = false
allowed_blank_lines = 1
array_auto_collapse = false
array_auto_expand = true
array_trailing_comma = true
column_width = 88
compact_inline_tables = true
indent_string = " "
reorder_arrays = true
reorder_keys = true
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"mhutchie.git-graph",
"ms-python.black-formatter",
"ms-python.python",
"redhat.vscode-yaml",
"stkb.rewrap",
Expand All @@ -20,6 +21,7 @@
],
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
Expand Down
Loading

0 comments on commit dcd6f81

Please sign in to comment.