-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Better import organization #16
Comments
If one import does not fit in one line, it should be divided at convenience, but trying to make it not look very bad, for example: This is prefered: import
"."/[reallyLongName,
reallyReallyLongName,
reallyReallyReallyLongName] To this: import
"."/[reallyLongName, reallyReallyLongName,
reallyReallyReallyLongName] |
Also, if the module to be imported can be separated by import
std/[foo] And not: import
std/foo |
Always separate the |
As can be seen from previous rules and examples, there can only be 1 |
Imports should be ordered alphabetically, both the part before the import
".."/[A, a, B, b] |
If importing a nimble package, Check https://nim-lang.org/docs/manual.html#modules-pseudo-importslashinclude-paths. |
Regarding exporting only the newline, ordering and only one statement per module rules should be followed while also, if possible, writing the fully qualified name of what's exported (exception being when exporting a whole module). Each exported symbol should be on a different line for better differentiation. |
There are some messy imports around, and I would like to rewrite them all in the same way. I think this is the best approach, which I encountered while doing #14:
The text was updated successfully, but these errors were encountered: