d-import-sort 0.0.1

A D script for sorting import statements.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

d-import-sort

A tool for sorting import declarations in D.

Usage

$ dub fetch d-import-sort
$ dub run d-import-sort <files>
<<<<filename:minline-maxline
unsorted imports
...
----
sorted imports
...
>>>>
...

Example

$ dub run -- ./source/dimportsort.d

<<<<./source/dimportsort.d:2-7
import std.algorithm : cmp, count, copy, map, setIntersection, sort;
import std.array : array, join;
import std.format : format;
import std.stdio : writeln;
import std.string : empty;
----
import std.algorithm : cmp, copy, count, map, setIntersection, sort;
import std.array : array, join;
import std.format : format;
import std.stdio : writeln;
import std.string : empty;
>>>>
<<<<./source/dimportsort.d:68-71
    import std.algorithm : find;
    import std.range : drop, take;
    import std.algorithm : maxElement, minElement, joiner, splitter;
----
    import std.algorithm : find;
    import std.algorithm : joiner, maxElement, minElement, splitter;
    import std.range : drop, take;
>>>>

TODO

  • [x] parse import
  • [x] simple sorted output
  • [ ] color output
  • [ ] diff format output
  • [ ] max line length
Authors:
  • karita
Dependencies:
libdparse
Versions:
0.0.4 2021-Nov-23
0.0.3 2021-Nov-23
0.0.2 2021-Nov-22
0.0.1 2021-Nov-22
~master 2021-Nov-23
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 2 downloads this month

  • 2 downloads total

Score:
0.7
Short URL:
d-import-sort.dub.pm