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
Pylint 2.7.0 seems to ignore the min-similarity-lines setting #4118
Comments
We are seeing the same problem. All of our automated builds failed this morning. $ pylint --version
pylint 2.7.0
astroid 2.5
Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)] Workaround Reverting back to pylint 2.6.2. |
My projects pass if I disable This suggests that the As an aside, when I last did a profile of multi-job vs single-job runs, there was no wall-clock gain, but much higher CPU use (aka cost), so I would advice not using |
We have circumvented the problem by excluding R0801 in the "disable" setting of the pylintrc file. We needed to specify the issue by number - specifying it by name did not work. We run with jobs=4, BTW. |
I'm not sure if this is related, but when running pylint 2.7.1 with --jobs=0, pylint reports duplicate lines, but in the summary and final score, duplicate lines are not reported. For example:
|
It looks like it's due to:
the
by simply copying the |
Taken in isolation, this commit may appear heavy-weight. The intent here is to have a linter run and retain all state information about that run so we can inspect what happened. What this commit shows is that the checkers the linter knows about have the right config, but still multi-job [MJ] runs are incorrect. see: assert checker.config.min_similarity_lines == min_similarity_lines I think the MJ failiures are because SimilarChecker.reduce_map_data() constructs a new SimilarChecker and then the linter doesn't call set_option(). The process by which the set_option() calls are made in the normal run is opaque to me, but perhaps someone else has a better idea(?).
Taken in isolation, this commit may appear heavy-weight. The intent here is to have a linter run and retain all state information about that run so we can inspect what happened. What this commit shows is that the checkers the linter knows about have the right config, but still multi-job [MJ] runs are incorrect. see: assert checker.config.min_similarity_lines == min_similarity_lines I think the MJ failiures are because SimilarChecker.reduce_map_data() constructs a new SimilarChecker and then the linter doesn't call set_option(). The process by which the set_option() calls are made in the normal run is opaque to me, but perhaps someone else has a better idea(?).
Taken in isolation, this commit may appear heavy-weight. The intent here is to have a linter run and retain all state information about that run so we can inspect what happened. What this commit shows is that the checkers the linter knows about have the right config, but still multi-job [MJ] runs are incorrect. see: assert checker.config.min_similarity_lines == min_similarity_lines I think the MJ failiures are because SimilarChecker.reduce_map_data() constructs a new SimilarChecker and then the linter doesn't call set_option(). The process by which the set_option() calls are made in the normal run is opaque to me, but perhaps someone else has a better idea(?).
Taken in isolation, this commit may appear heavy-weight. The intent here is to have a linter run and retain all state information about that run so we can inspect what happened. What this commit shows is that the checkers the linter knows about have the right config, but still multi-job [MJ] runs are incorrect. see: assert checker.config.min_similarity_lines == min_similarity_lines I think the MJ failiures are because SimilarChecker.reduce_map_data() constructs a new SimilarChecker and then the linter doesn't call set_option(). The process by which the set_option() calls are made in the normal run is opaque to me, but perhaps someone else has a better idea(?).
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of globally disabling warning R801, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of globally disabling warning R801, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. No change log entry is needed, since the circumvention was introduced in the same package version. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of globally disabling warning R801, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. No change log entry is needed, since the circumvention was introduced in the same package version. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of disabling warning R801 on py<3.6, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. No change log entry is needed, since the circumvention was introduced in the same package version. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of disabling warning R801 on py<3.6, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. No change log entry is needed, since the circumvention was introduced in the same package version. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of disabling warning R801 on py<3.6, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. No change log entry is needed, since the circumvention was introduced in the same package version. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Details: * Pylint issue pylint-dev/pylint#4118 introduced in Pylint 2.7.0 was fixed in Pylint 2.10.0. This change accomodates the fix by removing the circumvention of disabling warning R801 on py<3.6, and by increasing the minimum version of Pylint to 2.10.0 for Python >=3.6. The Pylint version with the issue is not supported on earlier Python versions. No change log entry is needed, since the circumvention was introduced in the same package version. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Steps to reproduce
Current behavior
Before pylint 2.7.0, the min-similarity-lines setting was honored and caused shorter similar lines to be accepted.
Starting with pylint 2.7.0, the min-similarity-lines setting seems to be ignored and the common lines are always reported as an issue R0801, even when the min-similarity-lines setting is significantly larger than the number of common lines.
Expected behavior
The min-similarity-lines setting should be respected again as it was before pylint 2.7.0.
pylint --version output
pylint 2.7.0
astroid 2.5
Python 3.9.1 (default, Feb 1 2021, 20:41:56)
[Clang 12.0.0 (clang-1200.0.32.29)]
The text was updated successfully, but these errors were encountered: