Isort: Support google style guide

Created on 15 Jul 2019  路  3Comments  路  Source: PyCQA/isort

The google python style guide suggests enforcing one import per line which can be achieved with the force_single_line option. However they also suggest an exception for the typing module. I can't find any way of specifying this to isort, does it exist? If not would it be much effort to implement? I imagine that a nice way of doing this would be to allow specifying certain packages as overrides for the force_single_line rule.

enhancement

Most helpful comment

This is now supported in develop and will make it's way into the 5.0.0 release:

https://github.com/timothycrosley/isort/blob/develop/isort/profiles.py#L22

Thanks!

~Timothy

All 3 comments

The closest I've found is to use isort:skip like:

from typing import Any # isort:skip

However, isort puts these after other imports, which may not be what you need. See https://github.com/timothycrosley/isort/pull/843. Related https://github.com/timothycrosley/isort/issues/295.

This is now supported in develop and will make it's way into the 5.0.0 release:

https://github.com/timothycrosley/isort/blob/develop/isort/profiles.py#L22

Thanks!

~Timothy

awesome, thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pradyunsg picture pradyunsg  路  3Comments

kevindaum picture kevindaum  路  4Comments

orsenthil picture orsenthil  路  4Comments

whg517 picture whg517  路  3Comments

pawamoy picture pawamoy  路  3Comments