From 5b6038cab6a116a77c549c2fc2de1ac13bf8b51a Mon Sep 17 00:00:00 2001 From: Augusto Wagner Andreoli Date: Sat, 2 Mar 2019 01:12:56 +0100 Subject: [PATCH] feat: suggest installing poetry --- flake8_nitpick/__init__.py | 3 ++- nitpick-style.toml | 2 +- tests/test_pyproject_toml.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flake8_nitpick/__init__.py b/flake8_nitpick/__init__.py index ce9e0367..1e7c3ace 100644 --- a/flake8_nitpick/__init__.py +++ b/flake8_nitpick/__init__.py @@ -112,7 +112,8 @@ def load_toml(self) -> YieldFlake8Error: self.pyproject_path: Path = self.root_dir / PyProjectTomlChecker.file_name if not self.pyproject_path.exists(): yield self.flake8_error( - 1, f"{PyProjectTomlChecker.file_name} does not exist. Run 'poetry init' to create one." + 1, + f"{PyProjectTomlChecker.file_name} does not exist. Install poetry and run 'poetry init' to create it.", ) return diff --git a/nitpick-style.toml b/nitpick-style.toml index 9825fb95..e12a365b 100644 --- a/nitpick-style.toml +++ b/nitpick-style.toml @@ -3,7 +3,7 @@ [[files.absent]] file = "requirements.txt" -message = "Use 'poetry init' to create pyproject.toml and move dependencies to it" +message = "Install poetry, run 'poetry init' to create pyproject.toml, and move dependencies to it" [[files.absent]] file = ".isort.cfg" diff --git a/tests/test_pyproject_toml.py b/tests/test_pyproject_toml.py index 615bc7f7..e8725bc8 100644 --- a/tests/test_pyproject_toml.py +++ b/tests/test_pyproject_toml.py @@ -6,5 +6,5 @@ def test_missing_pyproject_toml(request): """Suggest poetry init when pyproject.toml does not exist.""" assert ProjectMock(request, pyproject_toml=False).lint().errors == { - f"NIP201 {PyProjectTomlChecker.file_name} does not exist. Run 'poetry init' to create one." + f"NIP201 {PyProjectTomlChecker.file_name} does not exist. Install poetry and run 'poetry init' to create it." }