You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose adding to vfmt grouping and sorting of imports almost the same as Python isort does. For now vfmt just deletes line breaks between imports.
I found an old feature request #9353, here I describe the feature in more detail.
Use Case
The goal is to make imports more visual and nice looking.
No more:
importmarkdownimportfoobar// local moduleimportlogimportwhisker.datamodelimportwhisker.templateimportnet.httpimportcontextimportnet.htmlimportmylocalmodimportio
Proposed Solution
Groups
It is worth dividing imports into three groups:
Modules from vlib
Third-party modules, installed via v install [--git] <module>
Local modules (found in the working directory relative to v.mod)
Groups should be separated by line breaks and follow each other in the above order.
General sorting
Each group individually must be sorted by type in alphabetical order. For example:
Describe the feature
I propose adding to vfmt grouping and sorting of imports almost the same as Python isort does. For now vfmt just deletes line breaks between imports.
I found an old feature request #9353, here I describe the feature in more detail.
Use Case
The goal is to make imports more visual and nice looking.
No more:
Proposed Solution
Groups
It is worth dividing imports into three groups:
v install [--git] <module>
Groups should be separated by line breaks and follow each other in the above order.
General sorting
Each group individually must be sorted by type in alphabetical order. For example:
Sorting imports by type
Sorting imports types in this order looks good:
Sorting selective imports
Symbols in selective imports should also be sorted:
For better look, lowercase named symbols must be placed after symbols starting with a capital letter:
Sorting precedence
The highest priority is sorting by groups. Then each group should be sorted by import type. Alphabetical sorting is performed last.
Other Information
No response
Acknowledgements
Version used
V 0.4.8 58fc4de
Environment details (OS name and version, etc.)
Not important.
Huly®: V_0.6-21381
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: