Skip to content

Commit 62e4f18

Browse files
committed
Don't generate trailing spaces
1 parent 07bd897 commit 62e4f18

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,39 @@ cradle:
1616
cabal:
1717
- path: "indexed-profunctors/src"
1818
component: "lib:indexed-profunctors"
19-
19+
2020
- path: "optics-th/src"
2121
component: "lib:optics-th"
22-
22+
2323
- path: "optics-th/tests"
2424
component: "optics-th:test:optics-th-tests"
25-
25+
2626
- path: "optics-vl/src"
2727
component: "lib:optics-vl"
28-
28+
2929
- path: "codegen/./Subtypes.hs"
3030
component: "optics-codegen:exe:optics-codegen-subtypes"
31-
31+
3232
- path: "optics-core/src"
3333
component: "lib:optics-core"
34-
34+
3535
- path: "optics-sop/src"
3636
component: "lib:optics-sop"
37-
37+
3838
- path: "optics-extra/src"
3939
component: "lib:optics-extra"
40-
40+
4141
- path: "template-haskell-optics/src"
4242
component: "lib:template-haskell-optics"
43-
43+
4444
- path: "optics/src"
4545
component: "lib:optics"
46-
46+
4747
- path: "optics/tests"
4848
component: "optics:test:optics-tests"
49-
49+
5050
- path: "metametapost/src/Cli.hs"
5151
component: "metametapost:exe:metametapost-optics"
52-
5352

5453
```
5554

src/Hie/Yaml.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ hieYaml sOrC pkgs =
1818
(sOrC <> ":\n" <> indent' pkgs)
1919

2020
indent' :: String -> String
21-
indent' = unlines . map (" " <>) . lines
21+
indent' =
22+
unlines
23+
. map
24+
( \l -> case l of
25+
"" -> ""
26+
_ -> " " <> l
27+
)
28+
. lines
2229

2330
cabalComponent :: Name -> Component -> (FilePath, String)
2431
cabalComponent n (Comp Lib "" p) = (T.unpack p, T.unpack $ "lib:" <> n)

0 commit comments

Comments
 (0)