Skip to content

Pylint doesn't check file if it's named exactly like the directory where the file is #8050

Open
@goldiee36

Description

@goldiee36

Bug description

If I have a file in a directory, and the filename is exactly the same as the directory name, I cannot make pylint to check that file if I am not inside of that directory.

Steps to reproduce:

mkdir something
echo "import yaml" > something/something
pylint something/something 

Nothing happens, but if I rename the file, it works:

mv something/something something/anything
pylint something/anything 

Now pylint works as expected.

If I step inside the directory (cd something) and run pylint for the file, it also works.

If I create an __init__.py file in the directory, pylint starts working from outside of the directory.

I cannot figure it out how to use pylint for these kind of files.

Command used

pylint something/something

Pylint output

pylint outputs nothing

Expected behavior

pylint does the check and outputs the result

Pylint version

pylint 2.15.6

OS / Environment

CentOS

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions