Skip to content

Commit d691b45

Browse files
committed
Convert validate.sh to cabal-validate
Closes #10317. A Haskell script will be easier to maintain and expand than the existing Bash script. This also adds a `--pattern PATTERN` option which lets you filter tests across all test suites.
1 parent 3a6f73e commit d691b45

File tree

5 files changed

+1004
-547
lines changed

5 files changed

+1004
-547
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ init: ## Set up git hooks and ignored revisions
2929

3030
.PHONY: style
3131
style: ## Run the code styler
32-
@fourmolu -q -i Cabal Cabal-syntax cabal-install
32+
@fourmolu -q -i Cabal Cabal-syntax cabal-install cabal-validate
3333

3434
.PHONY: style-modified
3535
style-modified: ## Run the code styler on modified files
36-
@git ls-files --modified Cabal Cabal-syntax cabal-install \
36+
@git ls-files --modified Cabal Cabal-syntax cabal-install cabal-validate \
3737
| grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {}
3838

3939
.PHONY: style-commit
4040
style-commit: ## Run the code styler on the previous commit
41-
@git diff --name-only HEAD $(COMMIT) Cabal Cabal-syntax cabal-install \
41+
@git diff --name-only HEAD $(COMMIT) Cabal Cabal-syntax cabal-install cabal-validate \
4242
| grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {}
4343

4444
# source generation: SPDX

cabal-validate/cabal-validate.cabal

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cabal-version: 3.0
2+
name: cabal-validate
3+
version: 1.0.0
4+
copyright: 2024-2024, Cabal Development Team (see AUTHORS file)
5+
license: BSD-3-Clause
6+
author: Cabal Development Team <[email protected]>
7+
synopsis: An internal tool for building and testing the Cabal package manager
8+
build-type: Simple
9+
10+
common warnings
11+
ghc-options: -Wall
12+
13+
executable cabal-validate
14+
import: warnings
15+
default-language: Haskell2010
16+
default-extensions:
17+
OverloadedStrings
18+
, NoFieldSelectors
19+
, DuplicateRecordFields
20+
, OverloadedRecordDot
21+
, TypeApplications
22+
ghc-options: -O -threaded -rtsopts -with-rtsopts=-N
23+
24+
if impl(ghc <9.6)
25+
-- Pattern exhaustiveness checker is not as good, misses a case.
26+
ghc-options: -Wno-incomplete-patterns
27+
28+
main-is: Main.hs
29+
hs-source-dirs: main
30+
31+
build-depends:
32+
base >=4 && <5
33+
, ansi-terminal >=1 && <2
34+
, turtle >=1 && <2
35+
, optparse-applicative >=0.18 && <1
36+
, containers >=0.6 && <1
37+
, directory >=1.0 && <2
38+
, text >=2 && <3
39+
, terminal-size >=0.3 && <1
40+
, time >=1 && <2

0 commit comments

Comments
 (0)