Skip to content

A005 (builtin module shadowing) should ignore private modules #12949

@jab

Description

@jab

I just updated from ruff 0.5.0 to 0.6.1, and had to add an ignore for A005 so that ruff check would continue to pass:

jab/bidict@57a0d0b

Without that ignore, it would fail as follows:

❯ pre-commit run --all-files --verbose --show-diff-on-failure ruff
ruff.....................................................................Failed
- hook id: ruff
- duration: 0.01s
- exit code: 1

bidict/_abc.py:1:1: A005 Module `_abc` is shadowing a Python builtin module
Found 1 error.

This check is failing because it treats even private builtin modules as not-to-be-shadowed, and Python provides a private _abc builtin:

❯ python -c 'import _abc'  # succeeds

I propose that private modules be excluded from this check.

Metadata

Metadata

Assignees

Labels

needs-decisionAwaiting a decision from a maintainerpreviewRelated to preview mode featuresruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions