File: next_pylint.py

package info (click to toggle)
python-azure 20251014%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 766,472 kB
  • sloc: python: 6,314,744; ansic: 804; javascript: 287; makefile: 198; sh: 198; xml: 109
file content (25 lines) | stat: -rw-r--r-- 846 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse

from typing import Optional, List

from .pylint import pylint


class next_pylint(pylint):
    def __init__(self):
        super().__init__()

    def register(
        self, subparsers: "argparse._SubParsersAction", parent_parsers: Optional[List[argparse.ArgumentParser]] = None
    ) -> None:
        """Register the next-pylint check. The next-pylint check installs the next version of pylint and runs pylint against the target package."""
        parents = parent_parsers or []
        p = subparsers.add_parser(
            "next-pylint", parents=parents, help="Run the pylint check with the next version of pylint"
        )
        p.set_defaults(func=self.run)

    def run(self, args: argparse.Namespace) -> int:
        """Run the next-pylint check command."""
        args.next = True
        return super().run(args)