aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-07-30 19:18:35 +0200
committerGravatar Johannes Christ <[email protected]>2024-07-30 19:18:35 +0200
commitb478e5e58852fd42a6723d186ee5ff005f53789f (patch)
treef29614a34f67ce3576ae7639b171a09eb94ac3f1
parentAllow access to gitconfig for pre-commit (diff)
Allow access for directory where pyproject.toml is
Previously, it would always use the current working directory, which was inaccurate when running poetry in a sub-directory of the project.
-rw-r--r--poetry_restrict_plugin/plugin.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/poetry_restrict_plugin/plugin.py b/poetry_restrict_plugin/plugin.py
index fb4d509..632f5bf 100644
--- a/poetry_restrict_plugin/plugin.py
+++ b/poetry_restrict_plugin/plugin.py
@@ -93,7 +93,7 @@ class RestrictPlugin(Plugin):
# Allow manipulation of files in our projects, e.g. for linters.
# We might need to check this more thoroughly. For instance, configuring custom
# filter programs in gitattributes might allow a sandbox escape.
- ruleset.allow(".")
+ ruleset.allow(os.path.dirname(poetry.pyproject_path))
ruleset.apply()