PyCQA / PyCQA/isort

Long absolute imports not getting wrapped

Open
#1,531 9 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
7k
Forks
687
Avg merge
4h 56m
Merged PRs (30d)
2

Description

I have a long absolute import statement as follows:

from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.vpc_rule_path_creator import \
    VPCRulePathCreator

When using -wl 120 -l 120 flags I'd expect to get something like

from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.\
    vpc_rule_path_creator import VPCRulePathCreator

But nothing changes and my import statements exceed maximum line length. I tried playing around with -m and other flags, but nothing seems to do the trick.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example with the -wl 120 and -l 120 CLI flags, then trace the import-wrapping behavior for long absolute imports. Done means the module path can wrap before the imported name while respecting the configured maximum line length.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.