summaryrefslogtreecommitdiff
path: root/tests/input
Commit message (Collapse)AuthorAgeFilesLines
* Simplify hard to maintain copyright noticePierre Sassoulas2022-03-242-2/+0
| | | | | | 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.
* Spelling and grammar fixesVille Skyttä2021-09-172-2/+2
|
* Remove the python3 porting mode from the codebasePierre Sassoulas2021-09-019-16/+7
| | | | | | 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 (#4796)Daniël van Noord2021-08-301-1/+1
| | | | | | | | | | | | | | | | * 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>
* [duplicate-code] Parse functions and class methods recursively when ↵Maksym Humetskyi2021-08-172-0/+54
| | | | | gathering signature lines (#4858) * [duplicate-code] Parse functions and class methods recursively when gathering signature lines
* [duplicate-code] Ignore decorators lines by similarities checker when ignore ↵Maksym Humetskyi2021-08-141-0/+6
| | | | | | | | | | | | 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>
* Performance improvment of the Similarity checker (#4565)hippo912021-07-282-0/+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-193-0/+18
| | | | | * Fix cyclic-import with TYPE_CHECKING * Use new astroid helper method
* [duplicate-code] Fix ignored empty functions by similarities checker with ↵Maksym Humetskyi2021-07-052-0/+14
| | | | | ignore-signatures option enabled (#4669) Co-authored-by: Maksym Humetskyi <mhumets@softserveinc.com>
* [duplicate-code] Fix crash when analysing empty function with docstringPierre Sassoulas2021-07-012-0/+6
| | | | Closes #4648
* Add ignore_signatures to similarity checker (#4474)Aditya Gupta2021-05-172-0/+23
| | | | | | * 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>
* Migrate func_w406.py to new functional testsPierre Sassoulas2021-03-141-10/+0
|
* Migrate func_first_arg.py to new functional testsPierre Sassoulas2021-03-141-42/+0
|
* Migrate func_w0613.py to new functional testsPierre Sassoulas2021-03-141-42/+0
|
* Migrate func_w0405.py to new functional testsPierre Sassoulas2021-03-141-31/+0
|
* Migrate func_w0611.py to new functional testsPierre Sassoulas2021-03-141-25/+0
|
* Migrate func_dotted_ancestor.py to new functional testsPierre Sassoulas2021-03-142-62/+0
|
* Migrate func_e12xx.py to new functional testsPierre Sassoulas2021-03-141-28/+0
|
* Migrate nonregr___file___global.py to new functional testsPierre Sassoulas2021-03-141-8/+0
|
* Migrate func_no_dummy_redefined.py to new functional testsPierre Sassoulas2021-03-141-14/+0
|
* Migrate func_module___dict__.py to new functional testsPierre Sassoulas2021-03-141-9/+0
|
* Migrate func_loopvar_in_dict_comp_py27.py to new functional testsPierre Sassoulas2021-03-141-8/+0
|
* Migrate func_unused_import_py30.py to new functional testsPierre Sassoulas2021-03-141-20/+0
|
* Migrate func_e13xx.py (format error) to new functional testsPierre Sassoulas2021-03-141-21/+0
|
* Migrate func_w0404.py (reimported) to new functional testsPierre Sassoulas2021-03-141-27/+0
|
* Migrate func_typecheck_callfunc_assigment.py to new functional testsPierre Sassoulas2021-03-071-61/+0
|
* Migrate all func_noerror_* to new functional testsPierre Sassoulas2021-03-0719-506/+0
|
* Migrate nameerror_on_string_substitution to new functional testsPierre Sassoulas2021-03-071-8/+0
|
* Migrate func_variables_unused_name_from_wilcard_import.py to new functional ↵Pierre Sassoulas2021-03-071-3/+0
| | | | tests
* Migrate func_noerror_new_style_class_py_30.py to new functional testsPierre Sassoulas2021-03-071-45/+0
|
* Migrate func_logging_not_lazy_with_logger to new functional testsPierre Sassoulas2021-03-071-13/+0
|
* Migrate func_e0012.py to new functional testsPierre Sassoulas2021-03-071-4/+0
|
* Migrate func_e0204.py to new functional testsPierre Sassoulas2021-03-071-20/+0
|
* Migrate func_w0612.py to new functional testsPierre Sassoulas2021-03-071-37/+0
|
* bug2674Frank Harrison2021-03-061-0/+5
|
* Move excess escape functional test to new frameworkPierre Sassoulas2021-01-031-30/+0
|
* mapreduce| Adds map/reduce functionality to SimilarCheckerFrank Harrison2021-01-022-0/+99
| | | | | | | | | 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.
* Move func_bug113231 to new functional testsPierre Sassoulas2021-01-011-24/+0
|
* Move func_disable_linebased to new functional testsPierre Sassoulas2021-01-011-14/+0
|
* fixed issue 3726: enhanced similarity checker (#3837)Eli Fine2020-09-192-0/+50
| | | | | | | | | * 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>
* Add simplifiable-condition and condition-evals-to-constant to the ↵ethan-leba2020-08-311-1/+1
| | | | refactoring checker
* Chore: use https links (#3679)谭九鼎2020-06-113-3/+3
|
* Remove all tests concerning bad-continuationPierre Sassoulas2020-05-021-38/+0
|
* benchmark| Potential solution for performance regressions (#3473)Frank Harrison2020-04-261-0/+0
| | | | | | | | | | | | | * 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>
* Improve the testing around the new --fail-under flagClaudiu Popa2019-11-212-24/+0
|
* Add support for --fail-under flagsyutbai2019-11-212-0/+24
| | | | | | | | | | | 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
* ``import-outside-toplevel`` is emitted for ``ImportFrom`` nodes as well.Claudiu Popa2019-10-091-1/+1
| | | | Close #3175
* Removed Python 2 specific checksClaudiu Popa2019-09-172-18/+1
| | | | | Certain checks such as relative-import, invalid-encoded-data and missing-super-argument were removed as they no longer make sense on Python 3.
* New check: import-outside-toplevel (close #3067) (#3079)Nick Drozd2019-09-173-4/+4
|
* Stopped installing tests with packageAshley Whetter2019-06-2075-0/+1442