diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 24b82b0..0d62411 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.0 + rev: 0.29.1 hooks: - id: check-github-workflows args: [ "--verbose" ] @@ -20,11 +20,11 @@ repos: - id: tox-ini-fmt args: ["-p", "fix"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.1.4" + rev: "2.2.0" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.4" + rev: "v0.5.5" hooks: - id: ruff-format - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 442033f..c5d5ed2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,19 +33,19 @@ dynamic = [ "version", ] dependencies = [ - "pyproject-fmt-rust==1.1.5", + "pyproject-fmt-rust==1.1.6", "tomli>=2.0.1; python_version<'3.11'", ] optional-dependencies.docs = [ - "furo>=2024.5.6", - "sphinx>=7.3.7", + "furo>=2024.7.18", + "sphinx>=7.4.4", "sphinx-argparse-cli>=1.16", - "sphinx-autodoc-typehints>=2.2.2", + "sphinx-autodoc-typehints>=2.2.3", "sphinx-copybutton>=0.5.2", ] optional-dependencies.test = [ "covdefaults>=2.3", - "pytest>=8.2.2", + "pytest>=8.3.2", "pytest-cov>=5", "pytest-mock>=3.14", ] @@ -83,8 +83,9 @@ lint.ignore = [ "CPY", # No copyright statements "D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible "D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible + "DOC501", # not working with Sphinx "ISC001", # Conflict with formatter - "S104", # Possible binding to all interface + "S104", # Possible binding to all interfaces ] lint.per-file-ignores."tests/**/*.py" = [ "D", # don"t care about documentation in tests diff --git a/src/pyproject_fmt/cli.py b/src/pyproject_fmt/cli.py index ed8b1f7..090d6be 100644 --- a/src/pyproject_fmt/cli.py +++ b/src/pyproject_fmt/cli.py @@ -55,6 +55,7 @@ def pyproject_toml_path_creator(argument: str) -> Path | None: :param argument: the string argument passed in :return: the pyproject.toml path or None if stdin + :raises ArgumentTypeError: invalid argument """ if argument == "-": return None # stdin, no further validation needed diff --git a/tests/test_main.py b/tests/test_main.py index ac5fca6..bd91196 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -89,9 +89,9 @@ def no_color(diff: Any) -> Any: ), ( '[build-system]\nrequires = ["hatchling>=0.14.0"]', - '[build-system]\nrequires = [\n "hatchling>=0.14",\n]\n', - "--- {0}\n\n+++ {0}\n\n@@ -1,2 +1,4 @@\n\n [build-system]\n-requires = " - '["hatchling>=0.14.0"]\n+requires = [\n+ "hatchling>=0.14",\n+]\n', + '[build-system]\nrequires = [ "hatchling>=0.14" ]\n', + "--- {0}\n\n+++ {0}\n\n@@ -1,2 +1,2 @@\n\n [build-system]\n-requires = " + '["hatchling>=0.14.0"]\n+requires = [ "hatchling>=0.14" ]\n', ), ], ) @@ -258,7 +258,7 @@ def test_pyproject_ftm_api_changed(tmp_path: Path, capsys: pytest.CaptureFixture """ filename = tmp_path / "pyproject.toml" filename.write_text(dedent(txt)) - res = run([str(filename), "--no-print-diff"]) + res = run([str(filename), "--no-print-diff", "--column-width", "20"]) assert res == 1 diff --git a/tox.ini b/tox.ini index 94a2796..b6293d3 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ commands = description = run static analysis and style check using flake8 skip_install = true deps = - pre-commit>=3.7.1 + pre-commit>=3.8 commands = pre-commit run --all-files --show-diff-on-failure python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")' @@ -43,7 +43,7 @@ commands = [testenv:type] description = run type check on code base deps = - mypy==1.10.1 + mypy==1.11.1 set_env = {tty:MYPY_FORCE_COLOR = 1} commands =