| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
git is the source of truth for the copyright, copyrite (the tool)
was taking exponentially longer with each release, and it's
polluting the code with sometime as much as 50 lines of names.
|
| |
|
|
|
|
|
|
| |
It's possible to use the python3 porting checker from
an older pylint version. But it's not evolving anymore
and was costing resource to maintain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add ``consider-using-f-string`` checker
This adds a checker for normal strings which are formatted
with ``.format()`` or '%'.
The message is a convention to nudge users towards using f-strings.
This closes #3592
* Update pylint code to use f-strings
After adding `consider-using-f-strings` the codebase showed numerous
cases of formatting which could be f-strings.
This commit changes most of these to become f-strings, or adds ignores.
* Apply suggestions from code review
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
| |
gathering signature lines (#4858)
* [duplicate-code] Parse functions and class methods recursively when gathering signature lines
|
|
|
|
|
|
|
|
|
|
|
|
| |
signatures flag enabled (#4840)
* [duplicate-code] Ignore decorators lines by similarities checker when ignore signatures flag enabled
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Maksym Humetskyi <mhumets@softserveinc.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Adds execution time measurements
* Remove @profile decorator
* Changes the whole algorithm. The old one, while being very readable, is a performance bottleneck especially when comparing two big files. Let's try a more efficient one...
* Use a copy of SuccessiveLinesLimits in the all_couples collection in order to avoid modification of the same object when removing successives common lines (in remove_successive method).
* Remove old algorithm (dead code now)
* Creates the LineSpecifs type, to be clearer when manipulating stripped lines.
* Adds type hint in the stripped_lines function signature. Modifies docstring for the same function
* LineSetStartCouple is now a classic class (no more NamedTuple). It allows to define __add__ dunder method to make operations clearer
* Adds __repr__ method to SuccessiveLinesLimits class. Also update the docstring
* Modifies the way the LinesChunk hash is computed. If the line is not empty or is empty but corresponds to a docstring then the hash is the classical one. Otherwise the hash is randomized in order to be sure that two empty lines corresponding to import line are not considered equal
* Empty lines that were comments before being stripped are considered as equal
* Rework the help message do distinguish the options
* Adds a full line of comments in the test and adapts the expected results
* ignore-docstrings by default is True and so all docstrings (differents or identicals) are considered identicals
* In case of multiprocessing reports options
* Simplifies the algoriothm and clarifies the use of the options. For now if something is ignored (docstrings, comments, signature, imports) then it is removed from stripped lines collection. No need of the LineType anymore. The drawback is that 2 chunks of lines in both file may have been detected as similar (which is correct) but have different number of lines because, for example, some comments are inserted and comments habe ignored.
* The CplSuccessiveLinesLimits is no more a NamedTuple because we added the effective_cm_lines_nb member which has to be mutable. It holds the number of "true" common lines between both files (i.e the number of common lines in both stripped lines collection)
* check_sim function is renamed filter_noncode_lines and check the similarities on the stripped lines collection (and no more the real lines collection). Adds the computation of the effective number of common lines (i.e the number of "true" common stripped lines)
* Adapts legacy code so that the effective number of common lines is printed (the number of common lines in both stripped lines collection) and the corresponding component of the first file is printed too.
* Updates the expected result so that they contain the effective common lines number
* Stripped lines are purged from all that is ignored (by default comments and docstrings). Adapts the expected result in consquence
* By default comment and docstrings are excluded from the comparison
* Print also the ending line number in the report
* Adapts the expected results to take into account the ending line number
* Takes into account Pierre-Sassoulas remarks
* Takes into accound the remarks of cdce8p
* The parameters of the SImilarChecker are read from configuration also in the __init__ method
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
|
|
|
|
| |
* Fix cyclic-import with TYPE_CHECKING
* Use new astroid helper method
|
|
|
|
|
| |
ignore-signatures option enabled (#4669)
Co-authored-by: Maksym Humetskyi <mhumets@softserveinc.com>
|
|
|
|
| |
Closes #4648
|
|
|
|
|
|
| |
* Add ignore_signatures to similarity checker
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
tests
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Before adding a new mixin this proves the concept works, adding tests as
examples of how this would work in the main linter.
The idea here is that, because `check_parallel()` uses a multiprocess
`map` function, that the natural follow on is to use a 'reduce`
paradigm. This should demonstrate that.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* fixed issue 3726 similarity checker false positive for lines without meaningful content
made unit test case more robust by pushing it closer to the minimum number of similarity lines limit
added 'r' in front of regular expression string to please pylint
Co-authored-by: Eli Fine <ubuntu@ip-172-31-89-59.ec2.internal>
|
|
|
|
| |
refactoring checker
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* benchmark| Add benchmarking option to tox
* benchmark| Adds basic performance benchmark baselines for pylint
Here we establish baseline benchmarks for the system when used in
minimal way.
Here we just confirm that -j1 vs -jN gives some boost in performance under
simple situations, establishing a baseline for other benchmarks.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add a --fail-under <score> flag, also configurable in a `.pylintrc`file
If the final score is more than the specified score, it's considered a
success and pylint exits with exit code 0. Otherwise, it's considered
a failure and pylint exits with its current exit code based on the
messages issued.
Close #2242
|
|
|
|
| |
Close #3175
|
|
|
|
|
| |
Certain checks such as relative-import, invalid-encoded-data and missing-super-argument
were removed as they no longer make sense on Python 3.
|
| |
|
|
|