Skip to content

[refactor] Use a generator for '_has_variadic_argument' #6770

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

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented May 31, 2022

Type of Changes

Type
βœ“ πŸ”¨ Refactoring

Description

Follow-up to #6769, probably a small performance increase (?), but I find this easier to understand.

@Pierre-Sassoulas Pierre-Sassoulas added the Minor πŸ’… Polishing pylint is always nice label May 31, 2022
@coveralls
Copy link

coveralls commented May 31, 2022

Pull Request Test Coverage Report for Build 2414623048

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 95.515%

Totals Coverage Status
Change from base Build 2414611819: -0.002%
Covered Lines: 16228
Relevant Lines: 16990

πŸ’› - Coveralls

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas merged commit 7aa1f08 into pylint-dev:main May 31, 2022
@Pierre-Sassoulas Pierre-Sassoulas deleted the faster-variadic-check-in-basic-checker branch May 31, 2022 11:25
@github-actions
Copy link
Contributor

πŸ€– Effect of this PR on checked open source code: πŸ€–

Effect on pandas:
The following fatal messages are now emitted: πŸ’£πŸ’₯

  1. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/test_common.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/test_common.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-31-11.txt'.
    Please check your changes on the following file:
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/test_common.py#L1
  2. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/sas/test_sas7bdat.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/sas/test_sas7bdat.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-31-11.txt'.
    Please check your changes on the following file:
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/sas/test_sas7bdat.py#L1
  3. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/excel/test_readers.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/excel/test_readers.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-31-11.txt'.
    Please check your changes on the following file:
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/excel/test_readers.py#L1
  4. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/pytables/test_read.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/pytables/test_read.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-31-11.txt'.
    Please check your changes on the following file:
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/pytables/test_read.py#L1

The following messages are now emitted:

  1. docstring-first-line-empty:
    First line empty in function docstring
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/console.py#L78
  2. too-many-try-statements:
    try clause contains 2 statements, expected at most 1
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/console.py#L86
  3. invalid-name:
    Variable name "ip" doesn't conform to '[a-z_][a-z0-9_]{2,30}$' pattern
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/console.py#L88

The following messages are no longer emitted:

  1. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/test_common.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/test_common.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-30-22.txt'.
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/test_common.py#L1
  2. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/sas/test_sas7bdat.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/sas/test_sas7bdat.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-30-22.txt'.
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/sas/test_sas7bdat.py#L1
  3. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/excel/test_readers.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/excel/test_readers.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-30-22.txt'.
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/excel/test_readers.py#L1
  4. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/pytables/test_read.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/tests/io/pytables/test_read.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-30-22.txt'.
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/tests/io/pytables/test_read.py#L1
  5. astroid-error:
    tests/.pylint_primer_tests/pandas-dev/pandas/pandas/io/formats/console.py: Fatal error while checking 'tests/.pylint_primer_tests/pandas-dev/pandas/pandas/io/formats/console.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/runner/.cache/pylint/pylint-crash-2022-05-30-22.txt'.
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/console.py#L1
  6. wrong-import-position:
    Import "from future import annotations" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L4
  7. wrong-import-position:
    Import "from functools import reduce" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L6
  8. wrong-import-position:
    Import "import itertools" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L7
  9. wrong-import-position:
    Import "import re" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L8
  10. wrong-import-position:
    Import "from typing import Any, Callable, Hashable, Iterable, Mapping, Sequence, cast" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L9
  11. wrong-import-position:
    Import "import warnings" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L18
  12. wrong-import-position:
    Import "import numpy as np" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L20
  13. wrong-import-position:
    Import "from pandas._libs.lib import is_list_like" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L22
  14. wrong-import-position:
    Import "from pandas._typing import IndexLabel, StorageOptions" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L23
  15. wrong-import-position:
    Import "from pandas.util._decorators import doc" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L27
  16. wrong-import-position:
    Import "from pandas.core.dtypes import missing" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L29
  17. wrong-import-position:
    Import "from pandas.core.dtypes.common import is_float, is_scalar" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L30
  18. wrong-import-position:
    Import "from pandas import DataFrame, Index, MultiIndex, PeriodIndex" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L35
  19. wrong-import-position:
    Import "import pandas.core.common as com" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L41
  20. wrong-import-position:
    Import "from pandas.core.shared_docs import _shared_docs" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L42
  21. wrong-import-position:
    Import "from pandas.io.formats._color_data import CSS4_COLORS" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L44
  22. wrong-import-position:
    Import "from pandas.io.formats.css import CSSResolver, CSSWarning" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L45
  23. wrong-import-position:
    Import "from pandas.io.formats.format import get_level_lengths" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L49
  24. wrong-import-position:
    Import "from pandas.io.formats.printing import pprint_thing" should be placed at the top of the module
    https://github.com/pandas-dev/pandas.git/blob/main/pandas/io/formats/excel.py#L50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor πŸ’… Polishing pylint is always nice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants