Skip to content

After #7423 the .pylintrc in parent directories isn't anymore found unless __init__.py in directory #8020

Closed
@Felixoid

Description

@Felixoid

Bug description

The configuration is stored in https://github.com/ClickHouse/ClickHouse/blob/master/.pylintrc, and if one works in https://github.com/ClickHouse/ClickHouse/tree/master/tests/ or any of the children directories, the config is not read because there's no __init__.py in parent directories.

Configuration

# vim: ft=config

[BASIC]
max-module-lines=2000
# due to SQL
max-line-length=200
# Drop/decrease them one day:
max-branches=50
max-nested-blocks=10
max-statements=200

[FORMAT]
ignore-long-lines = (# )?<?https?://\S+>?$

[MESSAGES CONTROL]
disable = missing-docstring,
          too-few-public-methods,
          invalid-name,
          too-many-arguments,
          keyword-arg-before-vararg,
          too-many-locals,
          too-many-instance-attributes,
          cell-var-from-loop,
          fixme,
          too-many-public-methods,
          wildcard-import,
          unused-wildcard-import,
          singleton-comparison,
          # pytest.mark.parametrize is not callable (not-callable)
          not-callable,
          # https://github.com/PyCQA/pylint/issues/3882
          # [Python 3.9] Value 'Optional' is unsubscriptable (unsubscriptable-object) (also Union)
          unsubscriptable-object,
          # Drop them one day:
          redefined-outer-name,
          broad-except,
          bare-except,
          no-else-return,
          global-statement

[SIMILARITIES]
# due to SQL
min-similarity-lines=1000

Command used

# in tests/ci
pylint *.py
ln -sr ../../.pylintrc .
pylint *.py

Pylint output

##### truncated for the first run, too long
------------------------------------------------------------------
Your code has been rated at 8.49/10 (previous run: 8.49/10, +0.00)

##### the config is symlinked with ln -sr

************* Module build_download_helper
build_download_helper.py:29:23: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
************* Module ccache_utils
ccache_utils.py:24:27: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
************* Module clickhouse_helper
clickhouse_helper.py:36:27: W3101: Missing timeout argument for method 'requests.post' can cause your program to hang indefinitely (missing-timeout)
clickhouse_helper.py:111:27: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
************* Module commit_status_helper
commit_status_helper.py:11:0: C0411: third party import "from github import Github" should be placed before "from ci_config import CI_CONFIG, REQUIRED_CHECKS" (wrong-import-order)
commit_status_helper.py:12:0: C0411: third party import "from github.Commit import Commit" should be placed before "from ci_config import CI_CONFIG, REQUIRED_CHECKS" (wrong-import-order)
commit_status_helper.py:13:0: C0411: third party import "from github.CommitStatus import CommitStatus" should be placed before "from ci_config import CI_CONFIG, REQUIRED_CHECKS" (wrong-import-order)
************* Module compatibility_check
compatibility_check.py:3:0: W4901: Deprecated module 'distutils.version' (deprecated-module)
compatibility_check.py:36:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
compatibility_check.py:46:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
************* Module compress_files
compress_files.py:9:30: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
compress_files.py:11:30: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
compress_files.py:26:33: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
compress_files.py:28:23: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
compress_files.py:35:10: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
compress_files.py:61:12: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
compress_files.py:65:12: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
************* Module get_previous_release_tag
get_previous_release_tag.py:54:19: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
************* Module jepsen_check
jepsen_check.py:50:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
jepsen_check.py:128:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
jepsen_check.py:163:7: R1714: Consider merging these comparisons with 'in' by using 'args.program not in ('server', 'keeper')'. Use a set instead if elements are hashable. (consider-using-in)
jepsen_check.py:224:11: W3101: Missing timeout argument for method 'requests.head' can cause your program to hang indefinitely (missing-timeout)
jepsen_check.py:228:15: W3101: Missing timeout argument for method 'requests.head' can cause your program to hang indefinitely (missing-timeout)
************* Module push_to_artifactory
push_to_artifactory.py:10:0: E0401: Unable to import 'artifactory' (import-error)
************* Module rerun_helper
rerun_helper.py:5:0: C0411: third party import "from github import Github" should be placed before "from commit_status_helper import get_commit, get_commit_filtered_statuses" (wrong-import-order)
rerun_helper.py:6:0: C0411: third party import "from github.CommitStatus import CommitStatus" should be placed before "from commit_status_helper import get_commit, get_commit_filtered_statuses" (wrong-import-order)
************* Module run_check
run_check.py:242:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module split_build_smoke_check
split_build_smoke_check.py:33:9: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
************* Module tee_popen
tee_popen.py:87:29: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)

------------------------------------------------------------------
Your code has been rated at 9.94/10 (previous run: 8.49/10, +1.45)

Expected behavior

As before #7423, the config should be searched until the repo root at least

Pylint version

pylint 2.15.9
astroid 2.12.13
Python 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0]

OS / Environment

Arch Linux

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions