Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#182)
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>
  • Loading branch information
pre-commit-ci[bot] committed Apr 16, 2024
1 parent bb60057 commit 1d06639
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.1
rev: 0.28.2
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
Expand All @@ -25,7 +25,7 @@ repos:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.5"
rev: "v0.3.7"
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion src/pyproject_fmt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def pyproject_toml_path_creator(argument: str) -> Path:
"""
path = Path(argument).absolute()
if path.is_dir():
path = path / "pyproject.toml"
path /= "pyproject.toml"
if not path.exists():
msg = "path does not exist"
raise ArgumentTypeError(msg)
Expand Down
9 changes: 5 additions & 4 deletions src/pyproject_fmt/formatter/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import operator
import re
from shutil import which
from subprocess import CalledProcessError, check_output # noqa: S404
Expand Down Expand Up @@ -62,18 +63,18 @@ def fmt_project(parsed: TOMLDocument, conf: Config) -> None: # noqa: C901
indent=conf.indent,
keep_full_version=conf.keep_full_version,
)
order_keys(opt_deps, (), sort_key=lambda k: k[0]) # pragma: no branch
order_keys(opt_deps, (), sort_key=operator.itemgetter(0)) # pragma: no branch

for of_type in ("scripts", "gui-scripts", "entry-points", "urls"):
if of_type in project:
table = cast(Table, project[of_type])
order_keys(table, (), sort_key=lambda k: k[0]) # pragma: no branch
order_keys(table, (), sort_key=operator.itemgetter(0)) # pragma: no branch

if "entry-points" in project: # order entry points sub-table
entry_points = cast(Table, project["entry-points"])
order_keys(entry_points, (), sort_key=lambda k: k[0]) # pragma: no branch
order_keys(entry_points, (), sort_key=operator.itemgetter(0)) # pragma: no branch
for entry_point in entry_points.values():
order_keys(entry_point, (), sort_key=lambda k: k[0]) # pragma: no branch
order_keys(entry_point, (), sort_key=operator.itemgetter(0)) # pragma: no branch

# order maintainers and authors table
# handle readme table
Expand Down

0 comments on commit 1d06639

Please sign in to comment.