astral-sh / astral-sh/ruff

Rule to enforce import module only

Open
#3,045 9 comments 22 reactions 0 assignees View on GitHub
needs-decision rule
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
1d 21h
Merged PRs (30d)
435

Description

The google style guide recommends importing modules only. https://google.github.io/styleguide/pyguide.html#22-imports. It would be great if there’s a rule to enforce that.

Contributor guide

Open the contributing guide

Research direction

Start with the Google Python Style Guide's imports section and inspect Ruff's existing import-related rules and tests to find the relevant rule entry points. Define which imports violate the module-only requirement, then add coverage showing that the rule reports those cases without rejecting permitted imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.