Some modules my organization uses have classes with all-uppercase names for devices with acronym names. Unfortunately, this causes them to look like constants in the eyes of PEP8 and therefore isort rules. For example: (both BeckhoffAxis and IMS are classes)
Expected sort:
from .epics_motor import BeckhoffAxis, IMS
Current sort:
from .epics_motor import IMS, BeckhoffAxis
I ran a few other tests, and as far as I can tell, isort is reading IMS as a constant and therefore moving it to the front of the list. I saw that this can be turned off using the order_by_type setting but we want this left on so that other types that we import are sorted separately.
Would it be possible to either:
known_class similar to how the known_{section} settings are used?The second option is unlikely to ever be supported because of how much magic that would require. However, I think the first is a great idea and would happily accept a pull request that supported it.
Thanks!
~Timothy
Related to #1259, I think at least updating the docs to state that it's not actually ordering by type, but really it's using case-sensitivity, would help explain what's going on.
This is implemented in develop and will be released in version 5.3.0 via the following new options:
constants=,classes=,variables=
Thanks!
~Timothy
5.3.0 has now been released to PyPI
Thanks!
~Timothy
Most helpful comment
This is implemented in develop and will be released in version 5.3.0 via the following new options:
constants=,classes=,variables=Thanks!
~Timothy