Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#46)
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>
  • Loading branch information
redeboer and pre-commit-ci[bot] committed Oct 9, 2023
1 parent 582a3f3 commit 3d4a9b2
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 87 deletions.
20 changes: 1 addition & 19 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,19 @@
"transisions"
],
"ignorePaths": [
"**/*.bib",
"**/.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",
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# cspell:ignore agilepathway commitlint kode

name: PR linting
on:
pull_request:
Expand All @@ -14,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,⚠️ Interface,📝 Docs,🔨 Maintenance,🖱️ DX
none_of: Epic,❌ Won't fix,💫 Good first issue
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@v1
- name: Install Dependencies
run: npm install @commitlint/config-conventional
- uses: JulienKode/[email protected]
- 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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pyvenv*/
!.github/*.yml
!.github/*/*.yml
!.gitpod.yml
!.markdownlint.json
!.pre-commit-config.yaml
!.readthedocs.yml
!.vscode/*.json
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ vscode:
extensions:
- charliermarsh.ruff
- christian-kohler.path-intellisense
- davidanson.vscode-markdownlint
- 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-vscode.live-server
- redhat.vscode-yaml
Expand Down
7 changes: 0 additions & 7 deletions .markdownlint.json

This file was deleted.

34 changes: 20 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 @@ -32,23 +32,26 @@ 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:
- --allow-labels
- --ignore-author
- --keep-issue-templates
- --no-notebooks
- --no-prettierrc
- --repo-name=bossdoc
- --repo-title=BOSS Documentation
- id: format-setup-cfg

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

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

Expand All @@ -63,36 +66,39 @@ repos:
.*\.py
)$
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint

- 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:
- --py36-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
exclude: (?x)^(labels.*\.toml)$
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

6 changes: 3 additions & 3 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"recommendations": [
"charliermarsh.ruff",
"christian-kohler.path-intellisense",
"davidanson.vscode-markdownlint",
"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-vscode.live-server",
"redhat.vscode-yaml",
Expand All @@ -21,6 +21,7 @@
],
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
Expand Down
23 changes: 10 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@
"[bibtex]": {
"editor.formatOnSave": false
},
"[git-commit]": {
"editor.rulers": [72],
"rewrap.wrappingColumn": 72
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.wordWrap": "off"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[pip-requirements]": {
"editor.wordWrap": "off"
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"black-formatter.importStrategy": "fromEnvironment",
"cSpell.enabled": true,
"editor.formatOnSave": true,
"editor.rulers": [88],
"files.watcherExclude": {
"**/*_cache/**": true,
"**/.eggs/**": true,
Expand All @@ -35,18 +40,10 @@
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"livePreview.defaultPreviewPath": "docs/_build/html",
"python.formatting.provider": "black",
"python.linting.banditEnabled": false,
"python.linting.enabled": false,
"python.linting.flake8Enabled": false,
"python.linting.mypyEnabled": false,
"python.linting.pydocstyleEnabled": false,
"python.linting.pylamaEnabled": false,
"python.linting.pylintEnabled": false,
"python.testing.pytestArgs": ["--color=no", "--no-cov"],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false,
"rewrap.wrappingColumn": 79,
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
"ruff.organizeImports": true,
"search.exclude": {
Expand Down
11 changes: 0 additions & 11 deletions commitlint.config.js

This file was deleted.

9 changes: 5 additions & 4 deletions docs/_templates/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

{%- for ismain, link in links[1:] -%} ,
<a href="{{ link }}"
>{% if ismain %}<strong>{% endif -%} [{{ loop.index }}] {%- if ismain %}</strong>{%
endif -%}
>{% if ismain %}<strong
>{% endif -%} [{{ loop.index }}] {%- if ismain %}</strong
>{% endif -%}
</a>
{%- endfor %} {%- else %} {{ firstname|e }} {%- endif %} {% endmacro %} {%- extends
"layout.html" %} {% set title = _('Index') %} {% block body %}
{%- endfor %} {%- else %} {{ firstname|e }} {%- endif %} {% endmacro %} {%-
extends "layout.html" %} {% set title = _('Index') %} {% block body %}

<h1 id="index">{{ _('Index') }}</h1>

Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ ignore = [
"D416",
"E501",
"SIM108",
"UP036",
]
show-fixes = true
target-version = "py37"
Expand All @@ -125,3 +126,17 @@ task-tags = ["cspell"]

[tool.ruff.pydocstyle]
convention = "google"

[tool.tomlsort]
all = false
ignore_case = true
in_place = true
sort_first = [
"build-system",
"project",
"tool.setuptools",
"tool.setuptools_scm",
]
sort_table_keys = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true

0 comments on commit 3d4a9b2

Please sign in to comment.