summaryrefslogtreecommitdiff
path: root/tests/messages
Commit message (Collapse)AuthorAgeFilesLines
* Performance improvment of the Similarity checker (#4565)hippo912021-07-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 (#4703)Marc Mueller2021-07-191-0/+0
| | | | | * Fix cyclic-import with TYPE_CHECKING * Use new astroid helper method
* Fix false negative 'use-symbolic-message-instead' and optimize itPierre Sassoulas2021-03-174-7/+7
| | | | | | use-symbolic-message-instead was not working for message with multiple new names and the function to get the symbol was suboptimal. Also made the solution copy pastable.
* Migrate func_w406.py to new functional testsPierre Sassoulas2021-03-141-1/+0
|
* Migrate func_first_arg.py to new functional testsPierre Sassoulas2021-03-141-9/+0
|
* Migrate func_w0613.py to new functional testsPierre Sassoulas2021-03-141-5/+0
|
* Migrate func_w0405.py to new functional testsPierre Sassoulas2021-03-141-4/+0
|
* Migrate func_w0611.py to new functional testsPierre Sassoulas2021-03-141-1/+0
|
* Migrate func_dotted_ancestor.py to new functional testsPierre Sassoulas2021-03-142-7/+0
|
* Migrate func_e12xx.py to new functional testsPierre Sassoulas2021-03-141-6/+0
|
* Migrate nonregr___file___global.py to new functional testsPierre Sassoulas2021-03-141-2/+0
|
* Migrate func_no_dummy_redefined.py to new functional testsPierre Sassoulas2021-03-141-2/+0
|
* Migrate func_module___dict__.py to new functional testsPierre Sassoulas2021-03-141-1/+0
|
* Migrate func_loopvar_in_dict_comp_py27.py to new functional testsPierre Sassoulas2021-03-141-1/+0
|
* Migrate func_unused_import_py30.py to new functional testsPierre Sassoulas2021-03-141-1/+0
|
* Migrate func_e13xx.py (format error) to new functional testsPierre Sassoulas2021-03-142-23/+0
|
* Migrate func_w0404.py (reimported) to new functional testsPierre Sassoulas2021-03-141-5/+0
|
* Migrate nameerror_on_string_substitution to new functional testsPierre Sassoulas2021-03-071-2/+0
|
* Migrate func_logging_not_lazy_with_logger to new functional testsPierre Sassoulas2021-03-071-4/+0
|
* Migrate func_e0012.py to new functional testsPierre Sassoulas2021-03-071-1/+0
|
* Migrate func_e0204.py to new functional testsPierre Sassoulas2021-03-071-2/+0
|
* Migrate func_w0612.py to new functional testsPierre Sassoulas2021-03-071-6/+0
|
* Move excess escape functional test to new frameworkPierre Sassoulas2021-01-031-9/+0
|
* Fix trailing whitespaces and trailing newlinesPierre Sassoulas2020-05-038-8/+2
|
* Brought back logging-fstring-interpolationAshley Whetter2020-04-272-6/+6
|
* Removed Python 2 specific checksClaudiu Popa2019-09-171-2/+0
| | | | | Certain checks such as relative-import, invalid-encoded-data and missing-super-argument were removed as they no longer make sense on Python 3.
* Stopped installing tests with packageAshley Whetter2019-06-2058-0/+238