Method: pylint.lint.run.Run.__init__
Calls: 265, Exceptions: 164, Paths: 24Back
Path 1: 72 calls (0.27)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '/Users/andrehora/Documents/git/projects-pat...
None (70) JSONReporter (2)
True (72)
object (72)
SystemExit (22)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 2: 39 calls (0.15)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', 'pylint.__pkginfo__', '--disable=invalid-nam...
None (36) TextReporter (3)
True (39)
object (39)
SystemExit (39)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 3: 32 calls (0.12)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '/Users/andrehora/Documents/git/projects-pat...
None (30) MultiReporter (1) JSONReporter (1)
True (32)
object (32)
SystemExit (32)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 4: 27 calls (0.1)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '--enable-all-extensions', '/Users/andrehora...
None (23) GenericTestReporter (3) TextReporter (1)
False (27)
object (27)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 5: 21 calls (0.08)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '--fail-under', '-10.000000', '--fail-on=mis...
None (21)
True (21)
object (21)
SystemExit (21)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 6: 14 calls (0.05)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '-j 2', 'not_here', 'not_here_too', '--persi...
None (14)
True (14)
object (14)
SystemExit (3)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 7: 13 calls (0.05)
['--rcfile=/tmp/this_file_does_not_exist', '--persistent=no'] (1) ['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testuti...
None (13)
False (7) True (6)
object (13)
SystemExit (13)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 8: 9 calls (0.03)
['/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/checkers/../regrtest_data/beyond_top_two', '-d all', '-e relative-beyond-top-level'...
None (9)
False (9)
object (9)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 9: 8 calls (0.03)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '/Users/andrehora/Documents/git/projects-pat...
None (7) TextReporter (1)
True (8)
object (8)
SystemExit (8)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 10: 5 calls (0.02)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '--persistent=no'] (1) ['--rcfile=/Users/and...
None (4) TextReporter (1)
True (5)
object (5)
SystemExit (5)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 11: 3 calls (0.01)
['/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/test_pylint_runners.py'] (2) ['--report', 'n', '--score', 'n', '--max-branches', '1...
None (3)
True (3)
object (3)
SystemExit (3)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 12: 3 calls (0.01)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '.', '--load-plugin', '--persistent=no'] (1)...
None (3)
True (3)
object (3)
SystemExit (3)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 13: 2 calls (0.01)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '-j 2', '/Users/andrehora/Documents/git/proj...
None (2)
True (2)
object (2)
SystemExit (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 14: 2 calls (0.01)
['/var/folders/yp/qx0crmvd4sbck7chb52sws500000gn/T/tmp69gv67af/changing.py', '--clear-cache-post-run=y'] (2)
None (2)
False (2)
object (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 15: 2 calls (0.01)
['--verbose'] (1) ['--ve'] (1)
None (2)
True (2)
object (2)
SystemExit (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 16: 2 calls (0.01)
[] (1) ['-h'] (1)
None (2)
False (2)
object (2)
None (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 17: 2 calls (0.01)
['generate', '-h'] (1) [''] (1)
None (2)
True (2)
object (2)
SystemExit (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 18: 2 calls (0.01)
['generate'] (1) ['-h'] (1)
None (2)
True (2)
object (2)
SystemExit (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 19: 2 calls (0.01)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '--load-plugins', 'unexistant', '--init-hook...
None (2)
True (2)
object (2)
RuntimeError (2)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 20: 1 calls (0.0)
['/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/test_pylint_runners.py', '--jobs=0'] (1)
GenericTestReporter (1)
True (1)
object (1)
SystemExit (1)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 21: 1 calls (0.0)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '--exit-zero', '/Users/andrehora/Documents/g...
None (1)
True (1)
object (1)
SystemExit (1)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 22: 1 calls (0.0)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '--version', '--persistent=no'] (1)
None (1)
True (1)
object (1)
SystemExit (1)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 23: 1 calls (0.0)
['--rcfile=/Users/andrehora/Documents/git/projects-pathspotter/pylint/pylint/testutils/testing_pylintrc', '/Users/andrehora/Documents/git/projects-pat...
None (1)
True (1)
object (1)
SystemExit (1)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)
Path 24: 1 calls (0.0)
['--never-use-this'] (1)
None (1)
True (1)
object (1)
SystemExit (1)
1def __init__(
2 self,
3 args: Sequence[str],
4 reporter: BaseReporter | None = None,
5 exit: bool = True, # pylint: disable=redefined-builtin
6 do_exit: Any = UNUSED_PARAM_SENTINEL,
7 ) -> None:
8 # Immediately exit if user asks for version
9 if "--version" in args:
10 print(full_version)
11 sys.exit(0)
12
13 self._rcfile: str | None = None
14 self._output: str | None = None
15 self._plugins: list[str] = []
16 self.verbose: bool = False
17
18 # Pre-process certain options and remove them from args list
19 try:
20 args = _preprocess_options(self, args)
21 except ArgumentPreprocessingError as ex:
22 print(ex, file=sys.stderr)
23 sys.exit(32)
24
25 # Determine configuration file
26 if self._rcfile is None:
27 default_file = next(config.find_default_config_files(), None)
28 if default_file:
29 self._rcfile = str(default_file)
30
31 self.linter = linter = self.LinterClass(
32 _make_run_options(self),
33 option_groups=self.option_groups,
34 pylintrc=self._rcfile,
35 )
36 # register standard checkers
37 linter.load_default_plugins()
38 # load command line plugins
39 linter.load_plugin_modules(self._plugins)
40
41 linter.disable("I")
42 linter.enable("c-extension-no-member")
43
44 # Register the options needed for 'pylint-config'
45 # By not registering them by default they don't show up in the normal usage message
46 if self._is_pylint_config:
47 _register_generate_config_options(linter._arg_parser)
48
49 args = _config_initialization(
50 linter, args, reporter, config_file=self._rcfile, verbose_mode=self.verbose
51 )
52
53 # Handle the 'pylint-config' command
54 if self._is_pylint_config:
55 warnings.warn(
56 "NOTE: The 'pylint-config' command is experimental and usage can change",
57 UserWarning,
58 )
59 code = _handle_pylint_config_commands(linter)
60 if exit:
61 sys.exit(code)
62 return
63
64 # Display help messages if there are no files to lint
65 if not args:
66 print(linter.help())
67 sys.exit(32)
68
69 if linter.config.jobs < 0:
70 print(
71 f"Jobs number ({linter.config.jobs}) should be greater than or equal to 0",
72 file=sys.stderr,
73 )
74 sys.exit(32)
75 if linter.config.jobs > 1 or linter.config.jobs == 0:
76 if ProcessPoolExecutor is None:
77 print(
78 "concurrent.futures module is missing, fallback to single process",
79 file=sys.stderr,
80 )
81 linter.set_option("jobs", 1)
82 elif linter.config.jobs == 0:
83 linter.config.jobs = _cpu_count()
84
85 if self._output:
86 try:
87 with open(self._output, "w", encoding="utf-8") as output:
88 linter.reporter.out = output
89 linter.check(args)
90 score_value = linter.generate_reports()
91 except OSError as ex:
92 print(ex, file=sys.stderr)
93 sys.exit(32)
94 else:
95 linter.check(args)
96 score_value = linter.generate_reports()
97
98 if do_exit is not UNUSED_PARAM_SENTINEL:
99 warnings.warn(
100 "do_exit is deprecated and it is going to be removed in a future version.",
101 DeprecationWarning,
102 )
103 exit = do_exit
104
105 if linter.config.clear_cache_post_run:
106 MANAGER.clear_cache()
107
108 if exit:
109 if linter.config.exit_zero:
110 sys.exit(0)
111 elif linter.any_fail_on_issues():
112 # We need to make sure we return a failing exit code in this case.
113 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
114 sys.exit(self.linter.msg_status or 1)
115 elif score_value is not None:
116 if score_value >= linter.config.fail_under:
117 sys.exit(0)
118 else:
119 # We need to make sure we return a failing exit code in this case.
120 # So we use self.linter.msg_status if that is non-zero, otherwise we just return 1.
121 sys.exit(self.linter.msg_status or 1)
122 else:
123 sys.exit(self.linter.msg_status)