Skip to content

Commit

Permalink
Pull in array split fix (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Jul 31, 2024
1 parent 125f7ee commit 605ba23
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
6 changes: 3 additions & 3 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.29.0
rev: 0.29.1
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
Expand All @@ -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
Expand Down
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/pyproject_fmt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
],
)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ 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")'

[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 =
Expand Down

0 comments on commit 605ba23

Please sign in to comment.