Skip to content

Guarantee a deterministic order when processing files for directory arguments. #9943

Open
@akamat10

Description

@akamat10

Bug description

While trying to investigate the primer indeterminacy issues we are seeing in PR, one thing I observed is that we don't impose any order in which we process files or directories when we call os.walk to discover files to process here. AFAIK the order of directories for files is not guaranteed in os.walk. This may cause inconsistent no-name-in-module or import-error due to name shadowing issues during different runs. I think we need to guarantee the order of filenames and directories that are processed. This is not the source of the primer issue as far as I can see but we should fix this anyway. Thoughts on this?

Configuration

No response

Command used

pylint my_directory

Pylint output

None

Expected behavior

Provide guaranteed order of processing files when a directory is passed.

Pylint version

pylint 3.2.7
astroid 3.2.4
Python 3.12.3

OS / Environment

No response

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions