Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-deterministic output from the code similarity check #9937

Open
praiskup opened this issue Sep 20, 2024 · 0 comments
Open

Non-deterministic output from the code similarity check #9937

praiskup opened this issue Sep 20, 2024 · 0 comments
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling

Comments

@praiskup
Copy link

praiskup commented Sep 20, 2024

Bug description

The output message "Similar lines in files" is not deterministic on reported module paths.

Originally debugged here: fedora-copr/vcs-diff-lint#30

Configuration

No response

Command used

$ git clone https://github.com/rpm-software-management/mock.git
$ cd mock && git checkout cf1cb1329694e7cff16bc35faf5837e5c9fad393
# See the output is changing:
$ while true; do pylint mock/py/mockbuild/backend.py mock/py/mockbuild/buildroot.py mock/py/mockbuild/plugins/rpkg_preprocessor.py mock/py/mockbuild/plugins/rpmautospec.py mock/tests/plugins/test_rpmautospec.py | grep Similar -A1 | grep == ; done
==mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==mockbuild.plugins.rpkg_preprocessor:[110:118]
==mockbuild.plugins.rpkg_preprocessor:[110:118]
==mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]
==py.mockbuild.plugins.rpkg_preprocessor:[110:118]

Pylint output

************* Module tests.plugins.test_rpmautospec
mock/tests/plugins/test_rpmautospec.py:1:0: R0801: 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,

Expected behavior

************* Module tests.plugins.test_rpmautospec
mock/tests/plugins/test_rpmautospec.py:1:0: R0801: 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,

Pylint version

python3-pylint-3.2.5-1.fc40.noarch
python3-pylint-3.2.5-2.fc41.noarch

OS / Environment

Fedora 40 and 41

Additional dependencies

No response

@praiskup praiskup added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling
Projects
None yet
Development

No branches or pull requests

1 participant