-
-
Notifications
You must be signed in to change notification settings - Fork 598
Add support for PyCharm style alphabetic sorting (edited from: all upper cases name is sorted top most) #890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems I find the root cause from #370, @timothycrosley replied:
So whether isort provides any configuration to disable such kind of separation? |
Hi @yyscamper! Yes, you can configure this! The default setting which causes this to happen is:
which defaults to True. Simply setting order_by_type to False in a config file or doing --dont-order-by-type on the command line should give you the behavior that you want. Thanks! ~Timothy |
Also, you can find a reasonably complete definition of all these settings here: https://github.com/timothycrosley/isort/wiki/isort-Settings. Thanks! ~Timothy |
this is the result after disabling from pkg import Action
from pkg import actual
from pkg import Bacoo
from pkg import BALL
from pkg import RC
from pkg import rc
from pkg import RCNewCode
from pkg import recorder |
Currently, when sorting without type ordering, isort ignores the casing of the strings, and gives you a fully alphabetic sort. Is your intention to have an non-typed, but case aware sort? |
@timothycrosley yes, that's what I want. Most people in my team uses PyCharm, this is the default behavior for PyCharm. |
Hi @yyscamper, I've added support for this in the lasted version of isort via the case_sensitive setting, as shown in the test uploaded to the pull request: https://github.com/timothycrosley/isort/pull/892/files#diff-e82bf52c272f12dee456325bfcb553d8R2850 Thanks! ~Timothy |
@timothycrosley I just tested using latest version, it works. Thank for you quick action on this. |
Below is the sorted result using my isort configuration, you could see the both 'BALL' and
RC
is placed at the top most. The nameAction
is placed below 'BALL' and 'RC' is not correct for me:What I expected is:
That means following the default python string odering:
So I wonder whether there is any configuration can make it?
Below is my isort configuration:
The text was updated successfully, but these errors were encountered: