Coverage for .tox/py313/lib/python3.13/site-packages/pylint_sort_functions/__init__.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.10.2, created at 2025-08-07 04:45 +0200

1"""PyLint plugin to enforce alphabetical sorting of functions and methods.""" 

2 

3from typing import TYPE_CHECKING 

4 

5from pylint_sort_functions import checker 

6 

7if TYPE_CHECKING: 

8 from pylint.lint import PyLinter 

9 

10 

11def register(linter: "PyLinter") -> None: # pylint: disable=function-should-be-private 

12 """Register the plugin with PyLint. 

13 

14 This function is called by PyLint when the plugin is loaded. 

15 It registers the FunctionSortChecker with the linter. 

16 

17 Note: This function must remain public as it's a required PyLint plugin entry point. 

18 

19 :param linter: The PyLint linter instance 

20 :type linter: PyLinter 

21 """ 

22 linter.register_checker(checker.FunctionSortChecker(linter))