Skip to content

Commit

Permalink
tests: Improve ebuild formatting
Browse files Browse the repository at this point in the history
- Use an asterisk at the end of the version when possible
- Add newline to DEPEND
- Avoid backslashes by passing an array to src_configure
- Drop trailing .0 components

Thanks-to: Sam James <[email protected]>
Signed-off-by: hololeap <[email protected]>
  • Loading branch information
hololeap committed Aug 28, 2023
1 parent e015ae7 commit 3481040
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 46 deletions.
47 changes: 26 additions & 21 deletions tests/data/golden/hakyll-4.16.1.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@ RDEPEND="
>=dev-haskell/blaze-markup-0.5.1:=[profile?] <dev-haskell/blaze-markup-0.9
>=dev-haskell/data-default-0.4:=[profile?] <dev-haskell/data-default-0.8
>=dev-haskell/file-embed-0.0.10.1:=[profile?] <dev-haskell/file-embed-0.0.16
>=dev-haskell/hashable-1.0:=[profile?] <dev-haskell/hashable-2
=dev-haskell/hashable-1*:=[profile?]
>=dev-haskell/lrucache-1.1.1:=[profile?] <dev-haskell/lrucache-1.3
>=dev-haskell/network-uri-2.6:=[profile?] <dev-haskell/network-uri-2.7
=dev-haskell/network-uri-2.6*:=[profile?]
>=dev-haskell/optparse-applicative-0.12:=[profile?] <dev-haskell/optparse-applicative-0.19
>=dev-haskell/parsec-3.0:=[profile?] <dev-haskell/parsec-3.2
>=dev-haskell/random-1.0:=[profile?] <dev-haskell/random-1.3
>=dev-haskell/parsec-3:=[profile?] <dev-haskell/parsec-3.2
>=dev-haskell/random-1:=[profile?] <dev-haskell/random-1.3
>=dev-haskell/regex-tdfa-1.1:=[profile?] <dev-haskell/regex-tdfa-1.4
>=dev-haskell/resourcet-1.1:=[profile?] <dev-haskell/resourcet-1.4
>=dev-haskell/scientific-0.3.4:=[profile?] <dev-haskell/scientific-0.4
>=dev-haskell/tagsoup-0.13.1:=[profile?] <dev-haskell/tagsoup-0.15
>=dev-haskell/time-locale-compat-0.1:=[profile?] <dev-haskell/time-locale-compat-0.2
>=dev-haskell/unordered-containers-0.2:=[profile?] <dev-haskell/unordered-containers-0.3
=dev-haskell/time-locale-compat-0.1*:=[profile?]
=dev-haskell/unordered-containers-0.2*:=[profile?]
>=dev-haskell/vector-0.11:=[profile?] <dev-haskell/vector-0.14
>=dev-haskell/wai-app-static-3.1:=[profile?] <dev-haskell/wai-app-static-3.2
=dev-haskell/wai-app-static-3.1*:=[profile?]
>=dev-haskell/yaml-0.8.11:=[profile?] <dev-haskell/yaml-0.12
>=dev-lang/ghc-8.10.6:=
|| (
( >=dev-haskell/aeson-1.0 <dev-haskell/aeson-1.6 )
( >=dev-haskell/aeson-2.0 <dev-haskell/aeson-2.3 )
( >=dev-haskell/aeson-1 <dev-haskell/aeson-1.6 )
( >=dev-haskell/aeson-2 <dev-haskell/aeson-2.3 )
)
dev-haskell/aeson:=[profile?]
|| (
( >=dev-haskell/text-0.11 <dev-haskell/text-1.3 )
( >=dev-haskell/text-2.0 <dev-haskell/text-2.1 )
( =dev-haskell/text-2.0* )
)
dev-haskell/text:=[profile?]
buildwebsite? (
|| (
( >=app-text/pandoc-2.11 <app-text/pandoc-2.20 )
( >=app-text/pandoc-3.0 <app-text/pandoc-3.2 )
( >=app-text/pandoc-3 <app-text/pandoc-3.2 )
)
app-text/pandoc:=[profile?]
)
Expand All @@ -60,7 +60,7 @@ RDEPEND="
previewserver? (
>=dev-haskell/fsnotify-0.2:=[profile?] <dev-haskell/fsnotify-0.5
>=dev-haskell/http-types-0.9:=[profile?] <dev-haskell/http-types-0.13
>=dev-haskell/wai-3.2:=[profile?] <dev-haskell/wai-3.3
=dev-haskell/wai-3.2*:=[profile?]
>=dev-haskell/warp-3.2:=[profile?] <dev-haskell/warp-3.4
)
!previewserver? (
Expand All @@ -74,27 +74,32 @@ RDEPEND="
usepandoc? (
|| (
( >=app-text/pandoc-2.11 <app-text/pandoc-2.20 )
( >=app-text/pandoc-3.0 <app-text/pandoc-3.2 )
( >=app-text/pandoc-3 <app-text/pandoc-3.2 )
)
app-text/pandoc:=[profile?]
)
"
DEPEND="${RDEPEND}
>=dev-haskell/cabal-3.2.1.0
DEPEND="
${RDEPEND}
>=dev-haskell/cabal-3.2.1
test? (
>=dev-haskell/quickcheck-2.8 <dev-haskell/quickcheck-2.15
>=dev-haskell/tasty-0.11 <dev-haskell/tasty-1.5
>=dev-haskell/tasty-golden-2.3 <dev-haskell/tasty-golden-2.4
=dev-haskell/tasty-golden-2.3*
>=dev-haskell/tasty-hunit-0.9 <dev-haskell/tasty-hunit-0.11
>=dev-haskell/tasty-quickcheck-0.8 <dev-haskell/tasty-quickcheck-0.11
)
"

src_configure() {
haskell-cabal_src_configure \
$(cabal_flag buildwebsite buildwebsite) \
$(cabal_flag checkexternal checkexternal) \
$(cabal_flag previewserver previewserver) \
$(cabal_flag usepandoc usepandoc) \
local config_args=(
$(cabal_flag buildwebsite buildwebsite)
$(cabal_flag buildwebsite buildwebsite)
$(cabal_flag checkexternal checkexternal)
$(cabal_flag previewserver previewserver)
$(cabal_flag usepandoc usepandoc)
$(cabal_flag watchserver watchserver)
)

haskell-cabal_src_configure "${config_args[@]}"
}
11 changes: 6 additions & 5 deletions tests/data/golden/microstache-1.0.2.3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ RDEPEND="
>=dev-lang/ghc-8.8.1:=
|| (
( >=dev-haskell/aeson-0.11 <dev-haskell/aeson-1.6 )
( >=dev-haskell/aeson-2.0.0.0 <dev-haskell/aeson-2.2 )
( >=dev-haskell/aeson-2 <dev-haskell/aeson-2.2 )
)
dev-haskell/aeson:=[profile?]
|| (
( >=dev-haskell/text-1.2.3.0 <dev-haskell/text-1.3 )
( >=dev-haskell/text-2.0 <dev-haskell/text-2.1 )
( >=dev-haskell/text-1.2.3 <dev-haskell/text-1.3 )
( =dev-haskell/text-2.0* )
)
dev-haskell/text:=[profile?]
"
DEPEND="${RDEPEND}
>=dev-haskell/cabal-3.0.0.0
DEPEND="
${RDEPEND}
>=dev-haskell/cabal-3
test? (
>=dev-haskell/base-orphans-0.8.7 <dev-haskell/base-orphans-0.9
>=dev-haskell/tasty-1.4.0.1 <dev-haskell/tasty-1.5
Expand Down
13 changes: 7 additions & 6 deletions tests/data/golden/time-compat-1.9.6.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ KEYWORDS="~amd64"

RDEPEND="
>=dev-haskell/base-orphans-0.8.4:=[profile?] <dev-haskell/base-orphans-0.10
>=dev-haskell/hashable-1.3.2.0:=[profile?] <dev-haskell/hashable-1.5
>=dev-haskell/hashable-1.3.2:=[profile?] <dev-haskell/hashable-1.5
>=dev-lang/ghc-8.8.1:=
"
DEPEND="${RDEPEND}
>=dev-haskell/cabal-3.0.0.0
DEPEND="
${RDEPEND}
>=dev-haskell/cabal-3
test? (
>=dev-haskell/base-compat-0.10.5 <dev-haskell/base-compat-0.14
>=dev-haskell/quickcheck-2.13 <dev-haskell/quickcheck-2.15
>=dev-haskell/tagged-0.8.6 <dev-haskell/tagged-0.9
>=dev-haskell/tasty-1.2.1 <dev-haskell/tasty-1.5
>=dev-haskell/tasty-hunit-0.10 <dev-haskell/tasty-hunit-0.11
>=dev-haskell/tasty-quickcheck-0.10 <dev-haskell/tasty-quickcheck-0.11
=dev-haskell/tasty-hunit-0.10*
=dev-haskell/tasty-quickcheck-0.10*
|| (
( >=dev-haskell/hunit-1.3.1 <dev-haskell/hunit-1.3.2 )
( >=dev-haskell/hunit-1.6.0.0 <dev-haskell/hunit-1.7 )
( >=dev-haskell/hunit-1.6 <dev-haskell/hunit-1.7 )
)
)
"
29 changes: 15 additions & 14 deletions tests/data/golden/tree-diff-0.2.2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,47 @@ RDEPEND="
>=dev-haskell/ansi-terminal-0.10:=[profile?] <dev-haskell/ansi-terminal-0.12
>=dev-haskell/ansi-wl-pprint-0.6.8.2:=[profile?] <dev-haskell/ansi-wl-pprint-0.7
>=dev-haskell/base-compat-0.10.5:=[profile?] <dev-haskell/base-compat-0.13
>=dev-haskell/bytestring-builder-0.10.8.2.0:=[profile?] <dev-haskell/bytestring-builder-0.11
>=dev-haskell/parsec-3.1.13.0:=[profile?] <dev-haskell/parsec-3.2
>=dev-haskell/bytestring-builder-0.10.8.2:=[profile?] <dev-haskell/bytestring-builder-0.11
>=dev-haskell/parsec-3.1.13:=[profile?] <dev-haskell/parsec-3.2
>=dev-haskell/parsers-0.12.10:=[profile?] <dev-haskell/parsers-0.13
>=dev-haskell/primitive-0.7.1.0:=[profile?] <dev-haskell/primitive-0.8
>=dev-haskell/primitive-0.7.1:=[profile?] <dev-haskell/primitive-0.8
>=dev-haskell/quickcheck-2.14.2:2=[profile?] <dev-haskell/quickcheck-2.15
>=dev-haskell/scientific-0.3.6.2:=[profile?] <dev-haskell/scientific-0.4
>=dev-haskell/semialign-1.2.0.1:=[profile?] <dev-haskell/semialign-1.3
>=dev-haskell/strict-0.4.0.1:=[profile?] <dev-haskell/strict-0.5
>=dev-haskell/tagged-0.8.6:=[profile?] <dev-haskell/tagged-0.9
>=dev-haskell/these-1.1.1.1:=[profile?] <dev-haskell/these-1.2
>=dev-haskell/unordered-containers-0.2.8.0:=[profile?] <dev-haskell/unordered-containers-0.3
>=dev-haskell/unordered-containers-0.2.8:=[profile?] <dev-haskell/unordered-containers-0.3
>=dev-haskell/uuid-types-1.0.3:=[profile?] <dev-haskell/uuid-types-1.1
>=dev-haskell/vector-0.12.0.0:=[profile?] <dev-haskell/vector-0.14
>=dev-haskell/vector-0.12:=[profile?] <dev-haskell/vector-0.14
>=dev-lang/ghc-8.10.6:=
|| (
( >=dev-haskell/aeson-1.4.6.0 <dev-haskell/aeson-1.5 )
( >=dev-haskell/aeson-1.5.6.0 <dev-haskell/aeson-1.6 )
( >=dev-haskell/aeson-2.0.0.0 <dev-haskell/aeson-2.2 )
( >=dev-haskell/aeson-1.4.6 <dev-haskell/aeson-1.5 )
( >=dev-haskell/aeson-1.5.6 <dev-haskell/aeson-1.6 )
( >=dev-haskell/aeson-2 <dev-haskell/aeson-2.2 )
)
dev-haskell/aeson:=[profile?]
|| (
( >=dev-haskell/hashable-1.2.7.0 <dev-haskell/hashable-1.4 )
( >=dev-haskell/hashable-1.2.7 <dev-haskell/hashable-1.4 )
( >=dev-haskell/hashable-1.4.0.1 <dev-haskell/hashable-1.5 )
)
dev-haskell/hashable:=[profile?]
|| (
( >=dev-haskell/text-1.2.3.0 <dev-haskell/text-1.3 )
( >=dev-haskell/text-2.0 <dev-haskell/text-2.1 )
( >=dev-haskell/text-1.2.3 <dev-haskell/text-1.3 )
( =dev-haskell/text-2.0* )
)
dev-haskell/text:=[profile?]
"
DEPEND="${RDEPEND}
>=dev-haskell/cabal-3.2.1.0
DEPEND="
${RDEPEND}
>=dev-haskell/cabal-3.2.1
test? (
dev-haskell/base-compat
>=dev-haskell/tasty-golden-2.3.1.1 <dev-haskell/tasty-golden-2.4
>=dev-haskell/tasty-quickcheck-0.10.1 <dev-haskell/tasty-quickcheck-0.11
>=dev-haskell/trifecta-2 <dev-haskell/trifecta-2.2
|| (
( >=dev-haskell/tasty-1.2 <dev-haskell/tasty-1.3 )
( =dev-haskell/tasty-1.2* )
( >=dev-haskell/tasty-1.3.1 <dev-haskell/tasty-1.4 )
( >=dev-haskell/tasty-1.4.2 <dev-haskell/tasty-1.5 )
)
Expand Down

0 comments on commit 3481040

Please sign in to comment.