importsort-d

Sort and format imports in DLang
Log | Files | Refs | README

commit f360bf497ae87c409b934d59bccc79dcf111dcac
parent 9b452be9d0e03c5e65377c807b005babb2ae0611
Author: Friedel Schoen <[email protected]>
Date:   Mon, 10 Oct 2022 17:21:12 +0200

adding logo to readme

Diffstat:
MREADME.md | 5+++--
Aassets/importsort-d.png | 0
Msrc/main.d | 6+++---
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md @@ -1,5 +1,7 @@ # Sort Imports for [D](https://dlang.org/) +<img src="assets/importsort-d.png" alt="logo" width="256" /> + `sortimport-d` can sort your dozens of `import`'s in a `.d` file (no matter where) ## Installation @@ -35,7 +37,6 @@ $ importsort-d [--inline [--keep]] [--out <output>] [--original] [--special] [<i | `-i, --inline` | changes the input | | `-k, --keep` | keeps a backup of the input | | `-o, --output <path>` | writes to `path` rather then writing to STDOUT | -| - | | | `-r, --original` | sorts by original rather then the binding | | `-s, --special` | public and static imports first | @@ -44,6 +45,6 @@ $ importsort-d [--inline [--keep]] [--out <output>] [--original] [--special] [<i This whole project is licensed under the beautiful terms of the `zlib-license`. -Further information [here](LICENSE) +Further information [here](/LICENSE) > made with love and a lot of cat memes \ No newline at end of file diff --git a/assets/importsort-d.png b/assets/importsort-d.png Binary files differ. diff --git a/src/main.d b/src/main.d @@ -3,13 +3,13 @@ module importsort; import core.stdc.stdlib : exit; -import std.algorithm : map, sort, findSplit; +import std.algorithm : findSplit, map, sort; import std.array : array; import std.file : copy, remove; import std.regex : ctRegex, matchFirst; import std.stdio : File, stderr, stdin, stdout; -import std.string : format, split, strip, stripLeft, indexOf; -import std.typecons : Yes, Tuple, tuple; +import std.string : format, indexOf, split, strip, stripLeft; +import std.typecons : Tuple, Yes, tuple; struct Identifier { string original;