mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 16:19:21 +00:00
Allow linting directories without __init__.py
This was a regressin in 2.5. Close #3528
This commit is contained in:
parent
385ce42419
commit
716bcc4e0e
|
@ -30,6 +30,10 @@ Release date: TBA
|
|||
|
||||
Close #3524
|
||||
|
||||
* Allow linting directories without `__init__.py` which was a regression in 2.5.
|
||||
|
||||
Close #3528
|
||||
|
||||
What's New in Pylint 2.5.0?
|
||||
===========================
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ def expand_modules(files_or_modules, black_list, black_list_re):
|
|||
continue
|
||||
|
||||
module_path = get_python_path(something)
|
||||
additional_search_path = [module_path] + path
|
||||
additional_search_path = [".", module_path] + path
|
||||
if os.path.exists(something):
|
||||
# this is a file or a directory
|
||||
try:
|
||||
|
|
|
@ -763,3 +763,18 @@ class TestRunTC:
|
|||
],
|
||||
code=0,
|
||||
)
|
||||
|
||||
def test_can_list_directories_without_dunder_init(self, tmpdir):
|
||||
test_directory = tmpdir / "test_directory"
|
||||
test_directory.mkdir()
|
||||
spam_module = test_directory / "spam.py"
|
||||
spam_module.write("'Empty'")
|
||||
|
||||
with tmpdir.as_cwd():
|
||||
self._runtest(
|
||||
[
|
||||
"--disable=missing-docstring, missing-final-newline",
|
||||
"test_directory",
|
||||
],
|
||||
code=0,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user