summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-08-10 11:01:05 +0200
committerGravatar Johannes Christ <[email protected]>2024-08-10 11:01:05 +0200
commit8f17c09a0aa6514658b78407a80d1f7c6604143d (patch)
treee8e7e5b5662c3219c4a6a9a81115718295da7760
parentAdd license disclaimer to README (diff)
Allow access to black cache
-rw-r--r--poetry_restrict_plugin/plugin.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/poetry_restrict_plugin/plugin.py b/poetry_restrict_plugin/plugin.py
index 1fc749d..51c99ff 100644
--- a/poetry_restrict_plugin/plugin.py
+++ b/poetry_restrict_plugin/plugin.py
@@ -90,6 +90,12 @@ class RestrictPlugin(Plugin):
# Allow determining mime types. Used for ruamel.yaml installation.
ruleset.allow("/etc/mime.types", rules=FSAccess.READ_FILE)
+ # Black cache access
+ ruleset.allow(
+ *existing_paths((os.path.expanduser("~/.cache/black"),)),
+ rules=FSAccess.READ_FILE | FSAccess.WRITE_FILE | FSAccess.READ_DIR,
+ )
+
pre_commit_cache = os.path.expanduser("~/.cache/pre-commit")
if os.path.exists(pre_commit_cache):
ruleset.allow(pre_commit_cache)