Coverage for lintro / parsers / hadolint / __init__.py: 44%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-04-03 18:53 +0000

1"""Hadolint parser module.""" 

2 

3from lintro.parsers.hadolint.hadolint_issue import HadolintIssue 

4from lintro.parsers.hadolint.hadolint_parser import parse_hadolint_output 

5 

6__all__ = ["HadolintIssue", "parse_hadolint_output"] 

7 

8 

9def __getattr__(name: str) -> type[HadolintIssue]: 

10 """Handle deprecated attribute access. 

11 

12 Args: 

13 name: str: Name of the attribute being accessed. 

14 

15 Returns: 

16 type: HadolintIssue class if name is "HadolintOutput". 

17 

18 Raises: 

19 AttributeError: If the attribute name is not "HadolintOutput". 

20 """ 

21 if name == "HadolintOutput": 

22 import warnings 

23 

24 warnings.warn( 

25 "HadolintOutput is deprecated, use HadolintIssue instead. " 

26 "HadolintOutput will be removed in a future version.", 

27 DeprecationWarning, 

28 stacklevel=2, 

29 ) 

30 return HadolintIssue 

31 raise AttributeError(f"module {__name__!r} has no attribute {name!r}")