Skip to content

Commit 0036dc0

Browse files
authored
fix-whitespace 0.0.8 for GHC 9.4 (#34)
- for GHC 9.4: relax bounds (`base`, `text`) - upgrade `stack.yaml`s - CHANGELOG - update badges in README
1 parent 6ab7d90 commit 0036dc0

File tree

11 files changed

+83
-43
lines changed

11 files changed

+83
-43
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,44 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.13.20211030
11+
# version: 0.15.20220525
1212
#
13-
# REGENDATA ("0.13.20211030",["github","fix-whitespace.cabal"])
13+
# REGENDATA ("0.15.20220525",["github","fix-whitespace.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
17-
- push
18-
- pull_request
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
1923
jobs:
2024
linux:
2125
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22-
runs-on: ubuntu-18.04
26+
runs-on: ubuntu-20.04
27+
timeout-minutes:
28+
60
2329
container:
2430
image: buildpack-deps:bionic
2531
continue-on-error: ${{ matrix.allow-failure }}
2632
strategy:
2733
matrix:
2834
include:
29-
- compiler: ghc-9.2.1
35+
- compiler: ghc-9.4.0.20220501
3036
compilerKind: ghc
31-
compilerVersion: 9.2.1
37+
compilerVersion: 9.4.0.20220501
38+
setup-method: ghcup
39+
allow-failure: true
40+
- compiler: ghc-9.2.3
41+
compilerKind: ghc
42+
compilerVersion: 9.2.3
3243
setup-method: ghcup
3344
allow-failure: false
34-
- compiler: ghc-9.0.1
45+
- compiler: ghc-9.0.2
3546
compilerKind: ghc
36-
compilerVersion: 9.0.1
37-
setup-method: hvr-ppa
47+
compilerVersion: 9.0.2
48+
setup-method: ghcup
3849
allow-failure: false
3950
- compiler: ghc-8.10.7
4051
compilerKind: ghc
@@ -74,16 +85,17 @@ jobs:
7485
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
7586
if [ "${{ matrix.setup-method }}" = ghcup ]; then
7687
mkdir -p "$HOME/.ghcup/bin"
77-
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
88+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup"
7889
chmod a+x "$HOME/.ghcup/bin/ghcup"
90+
if $HEADHACKAGE; then "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; fi
7991
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
8092
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
8193
else
8294
apt-add-repository -y 'ppa:hvr/ghc'
8395
apt-get update
8496
apt-get install -y "$HCNAME"
8597
mkdir -p "$HOME/.ghcup/bin"
86-
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
98+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.8/x86_64-linux-ghcup-0.1.17.8 > "$HOME/.ghcup/bin/ghcup"
8799
chmod a+x "$HOME/.ghcup/bin/ghcup"
88100
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
89101
fi
@@ -116,7 +128,7 @@ jobs:
116128
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
117129
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
118130
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
119-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
131+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
120132
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
121133
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
122134
env:
@@ -145,6 +157,21 @@ jobs:
145157
repository hackage.haskell.org
146158
url: http://hackage.haskell.org/
147159
EOF
160+
if $HEADHACKAGE; then
161+
cat >> $CABAL_CONFIG <<EOF
162+
repository head.hackage.ghc.haskell.org
163+
url: https://ghc.gitlab.haskell.org/head.hackage/
164+
secure: True
165+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
166+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
167+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
168+
key-threshold: 3
169+
EOF
170+
fi
171+
cat >> $CABAL_CONFIG <<EOF
172+
program-default-options
173+
ghc-options: $GHCJOBS +RTS -M3G -RTS
174+
EOF
148175
cat $CABAL_CONFIG
149176
- name: versions
150177
run: |
@@ -192,6 +219,9 @@ jobs:
192219
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
193220
cat >> cabal.project <<EOF
194221
EOF
222+
if $HEADHACKAGE; then
223+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
224+
fi
195225
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(fix-whitespace)$/; }' >> cabal.project.local
196226
cat cabal.project
197227
cat cabal.project.local
@@ -219,6 +249,9 @@ jobs:
219249
run: |
220250
cd ${PKGDIR_fix_whitespace} || false
221251
${CABAL} -vnormal check
252+
- name: haddock
253+
run: |
254+
$CABAL v2-haddock --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
222255
- name: unconstrained build
223256
run: |
224257
rm -f cabal.project.local

.github/workflows/stack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-18.04
77
strategy:
88
matrix:
9-
ghc-ver: [9.2.1, 9.0.1, 8.10.7, 8.8.4, 8.6.5, 8.4.4, 8.2.2, 8.0.2]
9+
ghc-ver: [9.2.2, 9.0.2, 8.10.7, 8.8.4, 8.6.5, 8.4.4, 8.2.2, 8.0.2]
1010
fail-fast: false
1111
env:
1212
ARGS: "--stack-yaml stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc"

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
Version history.
44

5+
## 0.0.8 released 2022-05-29
6+
7+
- New option `--version` displaying program version.
8+
- Tested with GHC 8.0.2 - 9.4.1 alpha.
9+
510
## 0.0.7 released 2021-09-07
611

7-
- Supported GHC 8.10.7.
12+
- Support GHC 8.10.7.
813

914
## 0.0.6 released 2021-07-29
1015

@@ -14,5 +19,5 @@ Version history.
1419

1520
## 0.0.5 released 2021-03-11
1621

17-
- initial release.
18-
- tested with GHC 8.0.2 - 9.0.1.
22+
- Initial release.
23+
- Tested with GHC 8.0.2 - 9.0.1.

FixWhitespace.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
-- | Program to enforce a whitespace policy.
22

3+
module Main where
4+
35
import Control.Monad
46
import Control.Exception (IOException, handle)
57

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ fix-whitespace: Fixes whitespace issues
22
=======================================
33

44
[![Hackage version](https://img.shields.io/hackage/v/fix-whitespace.svg?label=Hackage&color=informational)](http://hackage.haskell.org/package/fix-whitespace)
5-
[![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/fix-whitespace/badge)](https://matrix.hackage.haskell.org/package/fix-whitespace)
65
[![fix-whitespace on Stackage Nightly](https://stackage.org/package/fix-whitespace/badge/nightly)](https://stackage.org/nightly/package/fix-whitespace)
76
[![Stackage LTS version](https://www.stackage.org/package/fix-whitespace/badge/lts?label=Stackage)](https://www.stackage.org/package/fix-whitespace)
87
[![Build status](https://github.com/agda/fix-whitespace/workflows/Build%20by%20Stack/badge.svg)](https://github.com/agda/fix-whitespace/actions)
9-
8+
[![Haskell-CI](https://github.com/agda/fix-whitespace/actions/workflows/haskell-ci.yml/badge.svg)](https://github.com/agda/fix-whitespace/actions/workflows/haskell-ci.yml)
109

1110
This tool can keep your project and repository clean of trailing
1211
whitespace and missing terminal newline.

cabal.haskell-ci

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
-- on Linux we can use ghcup to setup (some) of jobs
2-
-- hvr-ppa latest are 9.0.1 and 8.10.4
3-
ghcup-jobs: >= 9.2 || > 8.10.4 && < 9.0
1+
branches: master

fix-whitespace.cabal

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
name: fix-whitespace
22
version: 0.0.8
3-
cabal-version: >= 1.10
3+
cabal-version: 1.24
44
build-type: Simple
55
description: Removes trailing whitespace, lines containing only whitespace and ensure that every file ends in a newline character.
66
license: OtherLicense
77
license-file: LICENSE
88
author: fix-whitespace was originally written by Nils Anders Danielsson as part of Agda 2 with contributions from Ulf Norell, Andrés Sicard-Ramírez, Andreas Abel, Philipp Hausmann, Jesper Cockx, Vlad Semenov, and Liang-Ting Chen.
99
homepage: https://github.com/agda/fix-whitespace
1010
bug-reports: https://github.com/agda/fix-whitespace/issues
11-
maintainer: Liang-Ting Chen <[email protected]>
11+
maintainer: Liang-Ting Chen <[email protected]>, Andreas Abel
1212
Category: Text
1313
Synopsis: Fixes whitespace issues.
14-
tested-with: GHC == 8.0.2
15-
GHC == 8.2.2
16-
GHC == 8.4.4
17-
GHC == 8.6.5
18-
GHC == 8.8.4
19-
GHC == 8.10.7
20-
GHC == 9.0.1
21-
GHC == 9.2.1
14+
tested-with:
15+
GHC == 9.4.1
16+
GHC == 9.2.3
17+
GHC == 9.0.2
18+
GHC == 8.10.7
19+
GHC == 8.8.4
20+
GHC == 8.6.5
21+
GHC == 8.4.4
22+
GHC == 8.2.2
23+
GHC == 8.0.2
2224

2325
extra-source-files:
2426
CHANGELOG.md
@@ -30,7 +32,8 @@ extra-source-files:
3032
stack-8.6.5.yaml
3133
stack-8.8.4.yaml
3234
stack-8.10.7.yaml
33-
stack-9.0.1.yaml
35+
stack-9.0.2.yaml
36+
stack-9.2.2.yaml
3437

3538
source-repository head
3639
type: git
@@ -40,17 +43,18 @@ executable fix-whitespace
4043
hs-source-dirs: .
4144
main-is: FixWhitespace.hs
4245
other-modules: ParseConfig
46+
Paths_fix_whitespace
4347
default-language: Haskell2010
4448
default-extensions:
4549
LambdaCase
4650
ScopedTypeVariables
4751

48-
build-depends: base >= 4.9.0.0 && < 4.17
52+
build-depends: base >= 4.9.0.0 && < 5
4953
, directory >= 1.2.6.2 && < 1.4
5054
, extra >= 1.1 && < 2.0
5155
, filepath >= 1.4.1.0 && < 1.5
5256
, filepattern >= 0.1.2 && < 0.1.3
53-
, text >= 1.2.3.0 && < 1.3
57+
, text >= 1.2.3.0 && < 1.3 || == 2.0.*
5458
, yaml >= 0.8.4 && < 0.12
5559

5660
-- ASR (2018-10-16).

stack-8.10.7.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
resolver: lts-18.9
1+
resolver: lts-18.28
22
compiler: ghc-8.10.7
33
compiler-check: match-exact

stack-9.0.1.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

stack-9.0.2.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resolver: lts-19.8
2+
compiler: ghc-9.0.2
3+
compiler-check: match-exact

0 commit comments

Comments
 (0)