Skip to content

[primer] Create a class for easier comparison of pylint results#6984

Merged
DanielNoord merged 2 commits intopylint-dev:mainfrom
Pierre-Sassoulas:refactor-primer_comparator
Mar 17, 2026
Merged

[primer] Create a class for easier comparison of pylint results#6984
DanielNoord merged 2 commits intopylint-dev:mainfrom
Pierre-Sassoulas:refactor-primer_comparator

Conversation

@Pierre-Sassoulas
Copy link
Copy Markdown
Member

Type of Changes

Type
🔨 Refactoring

Description

Follow up to #6973

@Pierre-Sassoulas Pierre-Sassoulas added the Maintenance Discussion or action around maintaining pylint or the dev workflow label Jun 20, 2022
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the refactor-primer_comparator branch from 0915546 to a54c77e Compare June 20, 2022 12:27
@coveralls
Copy link
Copy Markdown

coveralls commented Jun 20, 2022

Pull Request Test Coverage Report for Build 2528939077

  • 37 of 37 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 95.287%

Totals Coverage Status
Change from base Build 2527590849: 0.002%
Covered Lines: 16600
Relevant Lines: 17421

💛 - Coveralls

@github-actions

This comment has been minimized.

Comment thread pylint/testutils/_primer/comparator.py Outdated
Comment thread pylint/testutils/_primer/primer_command.py Outdated
Comment thread pylint/testutils/_primer/comparator.py
@DanielNoord
Copy link
Copy Markdown
Collaborator

@Pierre-Sassoulas I would be okay with rebasing this and not doing the rename if that means we can merge this easily :)

@Pierre-Sassoulas
Copy link
Copy Markdown
Member Author

I think there was a concurrent change that forced to redo everything or at least a lot. (Which is why it's stuck not the rename). Might aknowledge the loss and redo from scratch later instead of trying to rebase then getting demoralised :) Also there was a gazillion thing on my todo list before that (too-few-logging and always suggest for no-member) but we now have a cache problem to fix first :D...

Pierre-Sassoulas added a commit that referenced this pull request Mar 7, 2026
Move cross-referencing and JSON loading from CompareCommand into a
dedicated PylintComparator class with an abstract Comparator base,
enabling future comparator implementations (e.g. AstroidComparator).

Closes #6984
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Mar 7, 2026
Move cross-referencing and JSON loading from CompareCommand into a
dedicated PylintComparator class with an abstract Comparator base,
enabling future comparator implementations (e.g. AstroidComparator).

Closes pylint-dev#6984
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the refactor-primer_comparator branch from c153227 to b0fa36d Compare March 16, 2026 12:04
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.16%. Comparing base (236eb8a) to head (fe2d79d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6984   +/-   ##
=======================================
  Coverage   96.16%   96.16%           
=======================================
  Files         177      178    +1     
  Lines       19617    19627   +10     
=======================================
+ Hits        18865    18875   +10     
  Misses        752      752           
Files with missing lines Coverage Δ
pylint/testutils/_primer/comparator.py 100.00% <100.00%> (ø)
pylint/testutils/_primer/primer_compare_command.py 94.91% <100.00%> (-1.68%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the refactor-primer_comparator branch from 7702cbb to ac37fbf Compare March 16, 2026 13:31
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Some small nits, but I'll stay on top of reviewing this so we can merge this and not let this get stale again.

Comment thread pylint/testutils/_primer/comparator.py

from pylint.testutils._primer.comparator import Comparator

FIXTURES_PATH = Path(__file__).parent / "fixtures"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FIXTURES_PATH = Path(__file__).parent / "fixtures"
CASES_PATH = Path(__file__).parent / "cases"

[
pytest.param(p, id=p.name)
for p in FIXTURES_PATH.iterdir()
if p.is_dir() and p.name != "batched" # tested separately
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps just move that case out of the directory then?

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the refactor-primer_comparator branch 2 times, most recently from 67f7cb5 to 617848e Compare March 17, 2026 17:11
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the refactor-primer_comparator branch from 617848e to 4eef601 Compare March 17, 2026 19:23
@DanielNoord
Copy link
Copy Markdown
Collaborator

@Pierre-Sassoulas Feels like a rebase went wrong here? There are some unrelated dependency updates in this PR.

Copy link
Copy Markdown
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the unrelated changes this LGTM!

@Pierre-Sassoulas Can you rebase again? I'll approve and merge afterwards!

@github-actions

This comment has been minimized.

Move the ``# pylint: enable=duplicate-code`` comment after the
``tempdir`` context manager so it is covered by the existing
suppression scope.
Move JSON loading, batching, and cross-referencing logic into a
dedicated Comparator class. CompareCommand.run() now delegates to
the Comparator and iterates over it to build the comment.
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the refactor-primer_comparator branch from 4eef601 to fe2d79d Compare March 17, 2026 19:55
@Pierre-Sassoulas
Copy link
Copy Markdown
Member Author

The duplicate-code change is required, I don't know why it suddenly fails, probably that the pre-commit grouping changed by adding new files.

@Pierre-Sassoulas Pierre-Sassoulas enabled auto-merge (rebase) March 17, 2026 20:17
@github-actions
Copy link
Copy Markdown
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit fe2d79d

@DanielNoord DanielNoord disabled auto-merge March 17, 2026 20:40
@DanielNoord DanielNoord merged commit d796007 into pylint-dev:main Mar 17, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Discussion or action around maintaining pylint or the dev workflow primer Skip news 🔇 This change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants