Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#48)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Remco de Boer <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and redeboer authored Jan 12, 2024
1 parent 3d4a9b2 commit f662538
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 48 deletions.
8 changes: 7 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"version": "0.2",
"enableFiletypes": ["git-commit", "julia", "jupyter"],
"enableFiletypes": [
"git-commit",
"github-actions-workflow",
"julia",
"jupyter"
],
"flagWords": [
"analyse",
"colour",
Expand All @@ -16,6 +21,7 @@
],
"ignorePaths": [
"**/*.bib",
"**/*.rst_t",
"**/.cspell.json",
".editorconfig",
".gitignore",
Expand Down
3 changes: 2 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
tasks:
- init: pyenv local 3.8
- init: pip install -e .[dev]

github:
Expand All @@ -19,13 +20,13 @@ vscode:
- 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
- Soulcode.vscode-unwanted-extensions
- stkb.rewrap
- streetsidesoftware.code-spell-checker
- tamasfe.even-better-toml
Expand Down
50 changes: 22 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly
skip:
- prettier
- pyright
- taplo

Expand All @@ -11,6 +12,20 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.2.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/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -31,32 +46,18 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
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.9.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
hooks:
- id: black

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

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
rev: 2.7.3
hooks:
- id: editorconfig-checker
name: editorconfig
Expand All @@ -67,24 +68,17 @@ repos:
)$
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier

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

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.1.13
hooks:
- id: ruff
args:
Expand Down
14 changes: 8 additions & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ version: 2
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false
fail_on_warning: true

formats:
- htmlzip

python:
version: 3.8
install:
- method: pip
path: .
build:
os: ubuntu-22.04
tools:
python: "3.8"
jobs:
post_install:
- pip install -e .[doc]
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"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",
"Soulcode.vscode-unwanted-extensions",
"stkb.rewrap",
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
Expand All @@ -22,6 +22,7 @@
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"garaioag.garaio-vscode-unwanted-recommendations",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
Expand All @@ -30,6 +30,7 @@
},
"black-formatter.importStrategy": "fromEnvironment",
"cSpell.enabled": true,
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.watcherExclude": {
"**/*_cache/**": true,
Expand All @@ -40,6 +41,7 @@
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"livePreview.defaultPreviewPath": "docs/_build/html",
"multiDiffEditor.experimental.enabled": true,
"python.testing.pytestArgs": ["--color=no", "--no-cov"],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": false,
Expand Down
13 changes: 6 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ def fetch_logo(url: str, output_path: str) -> None:
"members": True,
"undoc-members": True,
"show-inheritance": True,
"special-members": ", ".join(
[
"__call__",
"__eq__",
]
),
"special-members": ", ".join([
"__call__",
"__eq__",
]),
}
graphviz_output_format = "svg"
html_copy_source = True # needed for download notebook button
Expand Down Expand Up @@ -142,7 +140,7 @@ def fetch_logo(url: str, output_path: str) -> None:

# Intersphinx settings
intersphinx_mapping = {
"compwa-org": ("https://compwa-org.readthedocs.io/en/stable", None),
"compwa-org": ("https://compwa-org.readthedocs.io", None),
}

# Settings for autosectionlabel
Expand All @@ -162,6 +160,7 @@ def fetch_logo(url: str, output_path: str) -> None:
linkcheck_anchors = False
linkcheck_ignore = [
"http://code.ihep.ac.cn/redeboer/IniSelect",
"http://www.cmtsite.net",
"https://github.com/redeboer/BOSS_IniSelect_ORIGINAL",
"https://scientificlinux.org",
r"http://[A-Za-z0-9]+\.ihep\.ac\.cn",
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ dependencies:
- pip
- pip:
- -e .[dev]
variables:
PRETTIER_LEGACY_CLI: "1"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ task-tags = ["cspell"]
"docs/conf.py" = [
"A00",
"B006",
"D100",
"PLR0913",
]
"setup.py" = ["D100"]
Expand Down
11 changes: 8 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ classifiers =
python_requires = >=3.6
setup_requires =
setuptools_scm
install_requires =

[options.extras_require]
doc =
ipywidgets
jupyter
matplotlib
Expand All @@ -53,17 +55,20 @@ install_requires =
sphinx-togglebutton
sphinxcontrib-bibtex >=2
sphobjinv

[options.extras_require]
format =
black
lint =
ruff
sty =
%(format)s
%(lint)s
docutils
pre-commit >=1.4.0
pybtex
requests
Sphinx
dev =
%(doc)s
%(sty)s
jupyterlab
jupyterlab-code-formatter
Expand Down

0 comments on commit f662538

Please sign in to comment.