From 7da948c8e5d768e403c081dc1bafd0c29e88ae33 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 19 Sep 2021 19:16:20 +0300
Subject: [PATCH] Poetry check hook fixes.

- Add a test file for that hook.
- Fix the issues found.
---
 hooks/poetry_check.py     |  6 ++++--
 test_files/pyproject.toml | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 test_files/pyproject.toml

diff --git a/hooks/poetry_check.py b/hooks/poetry_check.py
index 942c99e..3071398 100644
--- a/hooks/poetry_check.py
+++ b/hooks/poetry_check.py
@@ -1,4 +1,4 @@
-"""Validate Docker Compose files."""
+"""Validate pyproject.toml files."""
 
 import argparse
 import pathlib
@@ -13,7 +13,9 @@ def main():
     args = parser.parse_args()
     hooks.utils.check_executable("poetry")
     return hooks.utils.bulk_check(
-        lambda x: hooks.utils.check_dir(["poetry", "check"], dir=x),
+        lambda x: hooks.utils.check_directory(
+            ["poetry", "check"], directory=x
+        ),
         hooks.utils.unique_directories(args.file),
     )
 
diff --git a/test_files/pyproject.toml b/test_files/pyproject.toml
new file mode 100644
index 0000000..25816ed
--- /dev/null
+++ b/test_files/pyproject.toml
@@ -0,0 +1,18 @@
+[tool.poetry]
+name = "mnpw"
+version = "0.1.5"
+description = "My Nagios plugin wrapper"
+authors = ["Adar Nimrod <nimrod@shore.co.il>"]
+license = "MIT"
+homepage = "https://git.shore.co.il/shore/mnpw"
+repository = "https://git.shore.co.il/shore/mnpw"
+classifiers = [
+    "Development Status :: 4 - Beta",
+    "Environment :: Console",
+    "Intended Audience :: Information Technology",
+    "Intended Audience :: System Administrators",
+    "License :: OSI Approved :: MIT License",
+    "Topic :: System :: Monitoring",
+    "Topic :: System :: Systems Administration",
+    "Topic :: Utilities",
+]
-- 
GitLab