summaryrefslogtreecommitdiffstats
path: root/tests/lint_tests/lint_tutil.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/lint_tests/lint_tutil.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/lint_tests/lint_tutil.py b/tests/lint_tests/lint_tutil.py
index 26df505..65fe0ad 100644
--- a/tests/lint_tests/lint_tutil.py
+++ b/tests/lint_tests/lint_tutil.py
@@ -3,8 +3,8 @@ from typing import List, Optional, Mapping, Any, Callable
import pytest
+from debputy.filesystem_scan import VirtualPathBase
from debputy.linting.lint_util import (
- LinterImpl,
LinterPositionCodec,
LintStateImpl,
LintState,
@@ -44,6 +44,7 @@ class LintWrapper:
self.dctrl_lines: Optional[List[str]] = None
self.path = path
self._dctrl_parser = dctrl_parser
+ self.source_root: Optional[VirtualPathBase] = None
self.lint_style_preference_table = StylePreferenceTable({}, {})
self.effective_preference: Optional[EffectivePreference] = None
@@ -57,11 +58,13 @@ class LintWrapper:
dctrl_lines, ignore_errors=True
)
)
+ source_root = self.source_root
+ debian_dir = source_root.get("debian") if source_root is not None else None
state = LintStateImpl(
self._debputy_plugin_feature_set,
self.lint_style_preference_table,
- None,
- None,
+ source_root,
+ debian_dir,
self.path,
"".join(dctrl_lines) if dctrl_lines is not None else "",
lines,
@@ -84,6 +87,7 @@ def check_diagnostics(
if diagnostics:
for diagnostic in diagnostics:
assert diagnostic.severity is not None
+ assert diagnostic.source is not None
return diagnostics