From 38032a201a53d651fc6bf6313fcca33e3f1335b6 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Tue, 30 Jul 2024 19:18:25 +0200 Subject: Allow access to gitconfig for pre-commit --- poetry_restrict_plugin/plugin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/poetry_restrict_plugin/plugin.py b/poetry_restrict_plugin/plugin.py index 4077a46..fb4d509 100644 --- a/poetry_restrict_plugin/plugin.py +++ b/poetry_restrict_plugin/plugin.py @@ -85,6 +85,10 @@ class RestrictPlugin(Plugin): pre_commit_cache = os.path.expanduser("~/.cache/pre-commit") if os.path.exists(pre_commit_cache): ruleset.allow(pre_commit_cache) + ruleset.allow( + *existing_paths((".gitconfig", os.path.expanduser("~/.config/git/config"))), + rules=FSAccess.READ_FILE, + ) # Allow manipulation of files in our projects, e.g. for linters. # We might need to check this more thoroughly. For instance, configuring custom -- cgit v1.2.3