Coverage for lintro / tools / definitions / __init__.py: 100%

0 statements  

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

1"""Tool definitions for Lintro. 

2 

3This package contains the tool definitions - small files that declare 

4what a tool IS (metadata, capabilities) without the implementation details. 

5 

6Each tool has a definition file that: 

71. Uses the @register_tool decorator to register with ToolRegistry 

82. Defines a ToolDefinition with all metadata 

93. Delegates actual execution to implementations/ 

10 

11Example: 

12 >>> # tools/definitions/hadolint.py 

13 >>> from lintro.plugins import register_tool, ToolDefinition 

14 >>> from lintro.plugins.base import BaseToolPlugin 

15 >>> 

16 >>> @register_tool 

17 ... class HadolintPlugin(BaseToolPlugin): 

18 ... @property 

19 ... def definition(self) -> ToolDefinition: 

20 ... return ToolDefinition( 

21 ... name="hadolint", 

22 ... description="Dockerfile linter", 

23 ... file_patterns=["Dockerfile", "Dockerfile.*"], 

24 ... ) 

25 

26The definitions are loaded by the discovery system when Lintro starts. 

27External plugins can follow the same pattern and register via entry points. 

28""" 

29 

30# Tool definitions are loaded dynamically by discovery.py 

31# This file just documents the package structure