Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#18)
Browse files Browse the repository at this point in the history
* DOC: make Colab TOC visible by default
* DX: lint PRs with shared commitlint config
* DX: merge `setup.cfg` into `pyproject.toml`
* DX: switch to `black-jupyter` hook
* DX: remove `.prettierrc`
* DX: remove GitHub Issue templates
* DX: synchronize ComPWA dev environment

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: GitHub <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2023
1 parent eeeb18b commit a389283
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 220 deletions.
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.

33 changes: 33 additions & 0 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: PR linting
on:
pull_request:
types:
- edited
- labeled
- opened
- reopened
- synchronize
- unlabeled

jobs:
check-labels:
name: Check labels
runs-on: ubuntu-22.04
steps:
- uses: docker://agilepathway/pull-request-label-checker:latest # cspell:ignore agilepathway
with:
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-22.04
steps:
- 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
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
30 changes: 0 additions & 30 deletions .gitpod.yml

This file was deleted.

33 changes: 20 additions & 13 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 @@ -27,7 +27,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.0.192
rev: 0.1.0
hooks:
- id: check-dev-files
args:
Expand All @@ -36,14 +36,10 @@ repos:
- --no-pypi
- --repo-name=ComPWA benchmarks
- --repo-title=benchmarks
- id: format-setup-cfg

- id: colab-toc-visible
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-black
additional_dependencies:
- black>=22.1.0
- id: nbqa-pyupgrade
args:
- --py37-plus
Expand All @@ -52,9 +48,12 @@ repos:
- --fix

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
- id: black-jupyter
args: [--line-length=85]
types_or: [jupyter]

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
Expand All @@ -77,6 +76,7 @@ repos:
cell.attachments
cell.metadata.code_folding
cell.metadata.id
cell.metadata.pycharm
cell.metadata.user_expressions
metadata.celltoolbar
metadata.colab.name
Expand All @@ -92,30 +92,37 @@ repos:
metadata.vscode
- 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
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
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"executablebookproject.myst-highlight",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"ms-python.black-formatter",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-vscode.live-server",
Expand All @@ -20,6 +22,7 @@
],
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
Expand Down
18 changes: 9 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"[git-commit]": {
"editor.rulers": [72],
"rewrap.wrappingColumn": 72
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
Expand All @@ -8,34 +12,30 @@
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.rulers": [],
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 80,
"editor.wrappingIndent": "same",
"editor.wrappingStrategy": "advanced"
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.enabled": true,
"black-formatter.importStrategy": "fromEnvironment",
"editor.formatOnSave": true,
"editor.rulers": [88],
"files.associations": {
".cspell/*.txt": "plaintext"
},
"files.eol": "\n",
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"livePreview.defaultPreviewPath": "docs/_build/html",
"notebook.gotoSymbols.showAllSymbols": true,
"python.analysis.autoImportCompletions": false,
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.linting.pydocstyleEnabled": false,
"python.linting.pylintEnabled": false,
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
"ruff.organizeImports": true
Expand Down
11 changes: 0 additions & 11 deletions commitlint.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions docs/visualize-jax-benchmark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@
}
],
"metadata": {
"colab": {
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
Expand Down
Loading

0 comments on commit a389283

Please sign in to comment.