Skip to content

[idea] sort the import lines alphabetically #611

@jabbalaci

Description

@jabbalaci

In Python, it's common to sort the import lines alphabetically. Also, imports from the stdlib are separated with a blank line from our own imports. Could we borrow these ideas from Python?

Example:

import euler;
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.array;

dfmt doesn't do anything with these lines. I think it'd look better the following way:

import std.algorithm;
import std.array;
import std.conv;
import std.stdio;
import std.string;

import euler;

Here, euler is my own module. It's separated from the stdlib modules with a blank line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions