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

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

2

3 from typing import TYPE_CHECKING

4

5 from pylint_sort_functions import checker

6

7 if TYPE_CHECKING:

8 from pylint.lint import PyLinter

9

10

11 def 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))