Skip to content

Commit cb8707e

Browse files
Prevent stats loss
1 parent 881e6bc commit cb8707e

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

doc/whatsnew/fragments/9059.bugfix

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Prevented data loss in the linter stats for messages relating
2+
to the linter itself (e.g. ``unknown-option-value``), fixing
3+
problems with score, fail-on, etc.
4+
5+
Closes #9059

pylint/lint/pylinter.py

-1
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,6 @@ def _check_astroid_module(
10711071

10721072
def open(self) -> None:
10731073
"""Initialize counters."""
1074-
self.stats = LinterStats()
10751074
MANAGER.always_load_extensions = self.config.unsafe_load_any_extension
10761075
MANAGER.max_inferable_values = self.config.limit_inference_results
10771076
MANAGER.extension_package_whitelist.update(self.config.extension_pkg_allow_list)

tests/test_check_parallel.py

+1
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def test_sequential_checkers_work(self) -> None:
382382
# now run the regular mode of checking files and check that, in this proc, we
383383
# collect the right data
384384
filepath = [single_file_container[0][1]] # get the filepath element
385+
linter.stats = LinterStats()
385386
linter.check(filepath)
386387
assert {
387388
"input.similar1": { # module is the only change from previous

0 commit comments

Comments
 (0)