summaryrefslogtreecommitdiffstats
path: root/src/debputy/lsp/lsp_debian_rules.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/debputy/lsp/lsp_debian_rules.py')
-rw-r--r--src/debputy/lsp/lsp_debian_rules.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/debputy/lsp/lsp_debian_rules.py b/src/debputy/lsp/lsp_debian_rules.py
index 86b114c..f05099d 100644
--- a/src/debputy/lsp/lsp_debian_rules.py
+++ b/src/debputy/lsp/lsp_debian_rules.py
@@ -1,3 +1,4 @@
+import functools
import itertools
import json
import os
@@ -152,10 +153,17 @@ def _lint_debian_rules(
)
+@functools.lru_cache
+def _is_project_trusted(source_root: str) -> bool:
+ return os.environ.get("DEBPUTY_TRUST_PROJECT", "0") == "1"
+
+
def _run_make_dryrun(
source_root: str,
lines: List[str],
) -> Optional[Diagnostic]:
+ if not _is_project_trusted(source_root):
+ return None
try:
make_res = subprocess.run(
["make", "--dry-run", "-f", "-", "debhelper-fail-me"],