Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#248)
Browse files Browse the repository at this point in the history
* MAINT: apply new black formatting

---------

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] authored Dec 8, 2023
1 parent 14fbd00 commit 8fde3f4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ci:
skip:
- check-dev-files
- mypy
- prettier
- pyright
- repoma-self-check
- taplo
Expand Down Expand Up @@ -56,7 +57,7 @@ repos:
files: ^\.pre\-commit\-(config|hooks)\.yaml$

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
rev: 23.11.0
hooks:
- id: black

Expand All @@ -66,7 +67,7 @@ repos:
- id: blacken-docs

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

Expand All @@ -92,17 +93,17 @@ repos:
- python

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.3-1
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.334
rev: v1.1.339
hooks:
- id: pyright

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.1.7
hooks:
- id: ruff
args: [--fix]
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"
12 changes: 5 additions & 7 deletions src/repoma/check_dev_files/citation.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ def remove_zenodo_json() -> None:


def _convert_zenodo(zenodo: dict) -> CommentedMap:
citation_cff = CommentedMap(
{
"cff-version": "1.2.0",
"message": "If you use this software, please cite it as below.",
"title": FoldedScalarString(zenodo["title"]),
}
)
citation_cff = CommentedMap({
"cff-version": "1.2.0",
"message": "If you use this software, please cite it as below.",
"title": FoldedScalarString(zenodo["title"]),
})

description = zenodo.get("description")
if description is not None:
Expand Down
10 changes: 4 additions & 6 deletions src/repoma/check_dev_files/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ def remove_deprecated_tools(keep_issue_templates: bool) -> None:


def _remove_github_issue_templates() -> None:
remove_configs(
[
".github/ISSUE_TEMPLATE",
".github/pull_request_template.md",
]
)
remove_configs([
".github/ISSUE_TEMPLATE",
".github/pull_request_template.md",
])


def _remove_markdownlint() -> None:
Expand Down
1 change: 1 addition & 0 deletions src/repoma/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Exceptions that are caught by a pre-commit hook and printed instead."""


class PrecommitError(RuntimeError):
pass
6 changes: 3 additions & 3 deletions src/repoma/utilities/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def sort_case_insensitive(dct): # type: ignore[no-untyped-def]
OrderedDict([('coverage-gutters', ['coverage.xml', 'test']), ('cSpell.enabled', True)])
"""
if isinstance(dct, abc.Mapping):
return collections.OrderedDict(
{k: sort_case_insensitive(dct[k]) for k in sorted(dct, key=str.lower)}
)
return collections.OrderedDict({
k: sort_case_insensitive(dct[k]) for k in sorted(dct, key=str.lower)
})
if isinstance(dct, str):
return dct
if isinstance(dct, abc.Iterable):
Expand Down

0 comments on commit 8fde3f4

Please sign in to comment.