Coverage for lintro / parsers / taplo / taplo_issue.py: 100%

9 statements  

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

1"""Taplo issue model. 

2 

3This module defines the TaploIssue dataclass for representing issues found 

4by the taplo TOML linter/formatter. 

5""" 

6 

7from __future__ import annotations 

8 

9from dataclasses import dataclass, field 

10from typing import ClassVar 

11 

12from lintro.parsers.base_issue import BaseIssue 

13 

14 

15@dataclass 

16class TaploIssue(BaseIssue): 

17 """Represents an issue found by taplo. 

18 

19 Attributes: 

20 DISPLAY_FIELD_MAP: Mapping of display field names to attribute names. 

21 level: Severity level (error, warning). 

22 code: Rule code (e.g., invalid_value, expected_table_array). 

23 """ 

24 

25 DISPLAY_FIELD_MAP: ClassVar[dict[str, str]] = { 

26 **BaseIssue.DISPLAY_FIELD_MAP, 

27 "severity": "level", 

28 } 

29 

30 level: str = field(default="error") 

31 code: str = field(default="")