fedora-copr / vcs-diff-lint

VCS Differential Code Analysis Tool
GNU General Public License v2.0
4 stars 2 forks source link

pylint: similarity warning not recognized as "old" #30

Closed praiskup closed 2 months ago

praiskup commented 2 months ago
# ================
#  Added warnings 
# ================
mock/tests/plugins/test_rpmautospec.py:1: R0801[duplicate-code]: Similar lines in 2 files
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpmautospec:[116:124]
        self.buildroot.doChroot(
            command,
            shell=False,
            cwd=chroot_sources,
            logger=self.buildroot.build_log,
            uid=self.buildroot.chrootuid,
            gid=self.buildroot.chrootgid,
            user=self.buildroot.chrootuser,

Error: PYLINT_WARNING:
# ================
#  Fixed warnings 
# ================
mock/tests/plugins/test_rpmautospec.py:1: R0801[duplicate-code]: Similar lines in 2 files
==mockbuild.plugins.rpkg_preprocessor:[110:118]
==mockbuild.plugins.rpmautospec:[116:124]
        self.buildroot.doChroot(
            command,
            shell=False,
            cwd=chroot_sources,
            logger=self.buildroot.build_log,
            uid=self.buildroot.chrootuid,
            gid=self.buildroot.chrootgid,
            user=self.buildroot.chrootuser,

https://github.com/rpm-software-management/mock/pull/1456

praiskup commented 2 months ago

This is a mystery, and I don't plan to go deeper. Just my observation:

For some reason (tested even with pylint-3.2.5-2.fc41.src.rpm) the old report claims the similarity is py.mockbuild and the new code claims mockbuild.plugins. It seems rather unfixable in csdiff/vcs-diff-lint :shrug:

praiskup commented 2 months ago

Actually reported as a non-deterministic pylint output: https://github.com/pylint-dev/pylint/issues/9937