Skip to content

Commit

Permalink
Swap tox.ini refs to pyproject.toml (#15)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
  • Loading branch information
bskinn authored and gaborbernat committed Mar 23, 2022
1 parent 3ace028 commit 6b7536f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/pyproject_fmt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ def as_config(self) -> Config:


def pyproject_toml_path_creator(argument: str) -> Path:
"""Validate that tox.ini can be formatted.
"""Validate that pyproject.toml can be formatted.
:param argument: the string argument passed in
:return: the tox.ini path
:return: the pyproject.toml path
"""
path = Path(argument).absolute()
if not path.exists():
raise ArgumentTypeError("path does not exists")
raise ArgumentTypeError("path does not exist")
if not path.is_file():
raise ArgumentTypeError("path is not a file")
if not os.access(path, os.R_OK):
Expand All @@ -51,7 +51,7 @@ def _build_cli() -> ArgumentParser:
msg = "print the formatted text to the stdout (instead of update in-place)"
parser.add_argument("-s", "--stdout", action="store_true", help=msg)
parser.add_argument("--indent", type=int, default=DEFAULT_INDENT, help="number of spaces to indent")
parser.add_argument("pyproject_toml", type=pyproject_toml_path_creator, help="tox ini file to format")
parser.add_argument("pyproject_toml", type=pyproject_toml_path_creator, help="pyproject.toml file to format")
return parser


Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_cli_pyproject_toml_not_exists(tmp_path: Path, capsys: pytest.CaptureFix
assert context.value.code != 0
out, err = capsys.readouterr()
assert not out
assert "argument pyproject_toml: path does not exists" in err
assert "argument pyproject_toml: path does not exist" in err


def test_cli_pyproject_toml_not_file(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
Expand Down

0 comments on commit 6b7536f

Please sign in to comment.