Compare commits
168 Commits
imports-so
...
master
Author | SHA1 | Date |
---|---|---|
|
e03ab8425b | |
|
420eac889e | |
|
0aa04af4eb | |
|
93a43bf28d | |
|
29814f919e | |
|
97da38fab7 | |
|
b59f885987 | |
|
3996efd5eb | |
|
ad88ba3f57 | |
|
46bf450530 | |
|
6b1e6fa73a | |
|
2fe1432631 | |
|
6151ba5825 | |
|
9e12a36a4f | |
|
ccabed9d7b | |
|
7399b75388 | |
|
7fa2a85b30 | |
|
a15eed5f36 | |
|
339d2ebf23 | |
|
8f2625dc87 | |
|
cddb98b124 | |
|
21e86adf6e | |
|
89a9f47b72 | |
|
ab59e9acc3 | |
|
b8532ca631 | |
|
cdc8405b10 | |
|
fa8365a7fa | |
|
8fadac8b2e | |
|
ccd09ba40a | |
|
8d7b46b9e9 | |
|
4079981b1d | |
|
4398b5880d | |
|
ac81c5ce90 | |
|
208240b62f | |
|
fdbbe9803d | |
|
4ee386a323 | |
|
a1cd4c5ed5 | |
|
51ca8fd5d7 | |
|
694ce973f4 | |
|
93172bfd21 | |
|
e22a647baa | |
|
79be0ed200 | |
|
93ba90e646 | |
|
5631e2500f | |
|
9a9b67d410 | |
|
d879125264 | |
|
c2248cb99c | |
|
0c720ee032 | |
|
75aed1cb8a | |
|
2ab406471b | |
|
95017640a8 | |
|
392e5b7569 | |
|
75cf5b83a3 | |
|
d03deccba8 | |
|
69e0f9fedf | |
|
33d2aa8790 | |
|
8a4bfe083e | |
|
d1968b5de3 | |
|
09f7e1726b | |
|
09fabe8d16 | |
|
72fd6959f7 | |
|
2dced782b1 | |
|
c02edecd1e | |
|
ce0aa4feec | |
|
7ce87381ae | |
|
bb3a7d0a5b | |
|
325798a02b | |
|
e3deff448a | |
|
32da5defb5 | |
|
1e7a94e72e | |
|
19a092b862 | |
|
56ccbc91a8 | |
|
d89cf0ad30 | |
|
0c33d9a6fa | |
|
c361ba545d | |
|
acdc30c227 | |
|
eccd2debb0 | |
|
b517eef71e | |
|
85359163cc | |
|
8290109e7f | |
|
1ad34aedcc | |
|
42cf56b106 | |
|
bfdb28010a | |
|
bd860f9983 | |
|
22361c4ecd | |
|
0f035faf3c | |
|
515595b432 | |
|
116930ac2b | |
|
7bd98ffb1c | |
|
abba8668f7 | |
|
9940aa4ae5 | |
|
ee5be0735b | |
|
434f9f8e49 | |
|
50f053cc2c | |
|
de6776b08c | |
|
7a7ea6c40d | |
|
4d064db674 | |
|
1a9863160b | |
|
3175a7c2b3 | |
|
256a30cdf8 | |
|
6b4e534840 | |
|
9658653ab9 | |
|
b1bfef5b8a | |
|
e8c4855cd3 | |
|
a13ad1b9da | |
|
cf48251c76 | |
|
8d4e03c53e | |
|
9e53988b1d | |
|
d7083e78bd | |
|
8a88e10625 | |
|
0b0c6d65ca | |
|
1b74b4274c | |
|
6346e2026a | |
|
6453e218ed | |
|
b34210b739 | |
|
0a710ab271 | |
|
c4b6a81b31 | |
|
9efed95d50 | |
|
f67e72e82c | |
|
fc5b1429f4 | |
|
d00387d156 | |
|
71e7f52014 | |
|
1e5b8ada4e | |
|
93ea6542cc | |
|
eb7a4811fd | |
|
5a65ed2356 | |
|
614bf3424d | |
|
63de13b0b4 | |
|
c6ad57e330 | |
|
7dedb0c17d | |
|
e36d9bc465 | |
|
259c949211 | |
|
096c438b23 | |
|
23dace16ed | |
|
045c387ff4 | |
|
cf3bc5daf4 | |
|
1e118a44ca | |
|
adb642353d | |
|
9913b45086 | |
|
b69a8f983c | |
|
17d07edb0a | |
|
10aec17005 | |
|
b960a3f4ac | |
|
2da92c403a | |
|
47865b708c | |
|
751ec8848a | |
|
f333302406 | |
|
fb8e3825aa | |
|
5f8d70e5f0 | |
|
2d8d1f4d86 | |
|
213de6a16c | |
|
52603fa8cb | |
|
05dd912283 | |
|
0a48b0f106 | |
|
01de8ea9b1 | |
|
e88872994b | |
|
d5a5bec729 | |
|
8e168f1578 | |
|
682f08c562 | |
|
64417c59f4 | |
|
7d68b1cc38 | |
|
9b8ed90a8f | |
|
55f84c3294 | |
|
2da8bd5e74 | |
|
dab4f0d557 | |
|
8c57372bde | |
|
5c64928972 | |
|
8778dcf2f4 |
|
@ -0,0 +1,30 @@
|
|||
ARG UBUNTU_TAG=20.04
|
||||
FROM ubuntu:"$UBUNTU_TAG"
|
||||
|
||||
ENV LANG=C.UTF-8
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install --assume-yes curl gcc git libgmp-dev libtinfo-dev make sudo
|
||||
|
||||
ARG GHCUP_VERSION=0.1.17.4
|
||||
RUN \
|
||||
curl --output /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION" && \
|
||||
chmod +x /usr/local/bin/ghcup && \
|
||||
ghcup --version
|
||||
|
||||
ARG USER_NAME=haskell
|
||||
RUN \
|
||||
useradd --create-home --shell "$( which bash )" "$USER_NAME" && \
|
||||
echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" | tee "/etc/sudoers.d/$USER_NAME"
|
||||
USER "$USER_NAME"
|
||||
ENV PATH="/home/$USER_NAME/.cabal/bin:/home/$USER_NAME/.ghcup/bin:$PATH"
|
||||
|
||||
ARG GHC_VERSION=9.0.1
|
||||
RUN \
|
||||
ghcup install ghc "$GHC_VERSION" --set && \
|
||||
ghc --version
|
||||
|
||||
ARG CABAL_VERSION=3.6.2.0
|
||||
RUN \
|
||||
ghcup install cabal "$CABAL_VERSION" --set && \
|
||||
cabal --version
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"postCreateCommand": "cabal update"
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { os: macos-11, ghc: 9.0.1, cabal: 3.6.2.0 }
|
||||
- { os: ubuntu-20.04, ghc: 9.0.1, cabal: 3.6.2.0 }
|
||||
- { os: windows-2019, ghc: 9.0.1, cabal: 3.6.2.0, ext: .exe }
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: mkdir artifact
|
||||
- run: mkdir artifact/${{ matrix.os }}
|
||||
- id: setup-haskell
|
||||
uses: haskell/actions/setup@v1
|
||||
with:
|
||||
ghc-version: ${{ matrix.ghc }}
|
||||
cabal-version: ${{ matrix.cabal }}
|
||||
- run: cabal configure --enable-tests --flags pedantic --jobs
|
||||
- run: cabal freeze
|
||||
- run: cat cabal.project.freeze
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.setup-haskell.outputs.cabal-store }}
|
||||
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-${{ hashFiles('cabal.project.freeze') }}
|
||||
restore-keys: |
|
||||
${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-
|
||||
${{ matrix.os }}-${{ matrix.ghc }}-
|
||||
- run: cabal build
|
||||
- run: cabal install --installdir artifact/${{ matrix.os }} --install-method copy
|
||||
- run: cabal test --test-show-details direct
|
||||
- run: cabal check
|
||||
- run: cabal sdist --output-dir artifact/${{ matrix.os }}
|
||||
- uses: svenstaro/upx-action@v2
|
||||
with:
|
||||
file: artifact/${{ matrix.os }}/brittany${{ matrix.ext }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: artifact
|
||||
name: brittany-${{ github.sha }}
|
||||
|
||||
release:
|
||||
needs: build
|
||||
if: github.event_name == 'release'
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: brittany-${{ github.sha }}
|
||||
path: artifact
|
||||
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
asset_content_type: application/octet-stream
|
||||
asset_name: brittany-${{ github.event.release.tag_name }}-ubuntu
|
||||
asset_path: artifact/ubuntu-20.04/brittany
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
asset_content_type: application/octet-stream
|
||||
asset_name: brittany-${{ github.event.release.tag_name }}-macos
|
||||
asset_path: artifact/macos-11/brittany
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
asset_content_type: application/octet-stream
|
||||
asset_name: brittany-${{ github.event.release.tag_name }}-windows.exe
|
||||
asset_path: artifact/windows-2019/brittany.exe
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
asset_content_type: application/gzip
|
||||
asset_name: brittany-${{ github.event.release.tag_name }}.tar.gz
|
||||
asset_path: artifact/ubuntu-20.04/brittany-${{ github.event.release.tag_name }}.tar.gz
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
|
||||
- run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-20.04/brittany-${{ github.event.release.tag_name }}.tar.gz
|
|
@ -8,9 +8,8 @@ dist/
|
|||
dist-newstyle/
|
||||
local/
|
||||
.cabal-sandbox/
|
||||
.stack-work/
|
||||
cabal.sandbox.config
|
||||
cabal.project.local
|
||||
cabal.project.local*
|
||||
cabal.project.freeze
|
||||
.ghc.environment.*
|
||||
result
|
||||
.stack-work*
|
||||
|
|
22
.hlint.yaml
22
.hlint.yaml
|
@ -5,20 +5,12 @@
|
|||
# This file contains a template configuration file, which is typically
|
||||
# placed as .hlint.yaml in the root of your project
|
||||
|
||||
# Specify additional command line arguments
|
||||
|
||||
- arguments:
|
||||
[ "--cpp-include=srcinc"
|
||||
, "--language=GADTs"
|
||||
, "--language=LambdaCase"
|
||||
, "--language=MultiWayIf"
|
||||
, "--language=KindSignatures"
|
||||
, "--cross"
|
||||
, "--threads=0"
|
||||
]
|
||||
|
||||
- ignore: {name: "Use camelCase"}
|
||||
- ignore: {name: "Redundant as"}
|
||||
- ignore: { name: 'Use :' }
|
||||
- ignore: { name: Eta reduce }
|
||||
- ignore: { name: Move brackets to avoid $ }
|
||||
- ignore: { name: Redundant $ }
|
||||
- ignore: { name: Redundant bracket }
|
||||
- ignore: { name: Use newtype instead of data }
|
||||
- ignore: {name: "Redundant do"}
|
||||
- ignore: {name: "Redundant return"}
|
||||
- ignore: {name: "Redundant guard", whithin: "lrdrNameToTextAnn"}
|
||||
- ignore: {name: "Use camelCase"}
|
||||
|
|
258
.travis.yml
258
.travis.yml
|
@ -1,258 +0,0 @@
|
|||
# Use new container infrastructure to enable caching
|
||||
sudo: false
|
||||
|
||||
# Do not choose a language; we provide our own build tools.
|
||||
language: generic
|
||||
|
||||
# Caching so the next build will be fast too.
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cabsnap
|
||||
- $HOME/.cabal/packages
|
||||
- $HOME/.stack
|
||||
- $HOME/.cabal/store
|
||||
# alternatively:
|
||||
#- $HOME/.stack/bin
|
||||
#- $HOME/.stack/precompiled
|
||||
#- $HOME/.stack/programs
|
||||
#- $HOME/.stack/setup-exe-cache
|
||||
#- $HOME/.stack/snapshots
|
||||
|
||||
before_cache:
|
||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
|
||||
# remove files that are regenerated by 'cabal update'
|
||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
|
||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
|
||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
|
||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
|
||||
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
|
||||
|
||||
# The different configurations we want to test. We have
|
||||
# - BUILD=cabal which uses cabal-install(<2.0)
|
||||
# - BUILD=canew which uses cabal-install 2.0 "new-build"
|
||||
# - BUILD=stack which uses Stack.
|
||||
#
|
||||
# We set the compiler values here to tell Travis to use a different
|
||||
# cache file per set of arguments.
|
||||
#
|
||||
# If you need to have different apt packages for each combination in the
|
||||
# matrix, you can use a line such as:
|
||||
# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
|
||||
matrix:
|
||||
include:
|
||||
|
||||
##### OSX test via stack #####
|
||||
|
||||
# Build on macOS in addition to Linux
|
||||
- env: BUILD=stack ARGS="--stack-yaml stack-8.2.2.yaml"
|
||||
compiler: ": #stack 8.2.2 osx"
|
||||
os: osx
|
||||
|
||||
##### CABAL #####
|
||||
|
||||
- env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal 8.0.2"
|
||||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
- env: BUILD=cabal GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal 8.2.2"
|
||||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
- env: BUILD=cabal GHCVER=8.4.4 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal 8.4.4"
|
||||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.4.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
- env: BUILD=cabal GHCVER=8.6.5 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal 8.6.5"
|
||||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.6.5,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
|
||||
# Build with the newest GHC and cabal-install. This is an accepted failure,
|
||||
# see below.
|
||||
#- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
# compiler: ": #GHC HEAD"
|
||||
# addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
|
||||
##### CABAL DIST CHECK
|
||||
|
||||
- env: BUILD=cabaldist GHCVER=8.2.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal 8.2.2 dist"
|
||||
addons: {apt: {packages: [cabal-install-1.24,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
|
||||
##### CANEW #####
|
||||
|
||||
- env: BUILD=canew GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal new 8.2.2"
|
||||
addons: {apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
- env: BUILD=canew GHCVER=8.8.1 CABALVER=3.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
compiler: ": #cabal new 8.8.1"
|
||||
addons: {apt: {packages: [cabal-install-3.0,ghc-8.8.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
|
||||
|
||||
##### STACK #####
|
||||
|
||||
# The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
|
||||
# variable, such as using --stack-yaml to point to a different file.
|
||||
- env: BUILD=stack ARGS=""
|
||||
compiler: ": #stack default"
|
||||
addons: {apt: {packages: [libgmp-dev]}}
|
||||
|
||||
- env: BUILD=stack ARGS="--stack-yaml stack-8.0.2.yaml"
|
||||
compiler: ": #stack 8.0.2"
|
||||
addons: {apt: {packages: [libgmp-dev]}}
|
||||
- env: BUILD=stack ARGS="--stack-yaml stack-8.2.2.yaml"
|
||||
compiler: ": #stack 8.2.2"
|
||||
addons: {apt: {packages: [libgmp-dev]}}
|
||||
- env: BUILD=stack ARGS="--stack-yaml stack-8.4.3.yaml"
|
||||
compiler: ": #stack 8.4.3"
|
||||
addons: {apt: {packages: [libgmp-dev]}}
|
||||
- env: BUILD=stack ARGS="--stack-yaml stack-8.6.5.yaml"
|
||||
compiler: ": #stack 8.6.5"
|
||||
addons: {apt: {packages: [libgmp-dev]}}
|
||||
|
||||
# Nightly builds are allowed to fail
|
||||
- env: BUILD=stack ARGS="--resolver nightly"
|
||||
compiler: ": #stack nightly"
|
||||
addons: {apt: {packages: [libgmp-dev]}}
|
||||
|
||||
allow_failures:
|
||||
#- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
|
||||
- env: BUILD=stack ARGS="--resolver nightly"
|
||||
- env: BUILD=stack ARGS=""
|
||||
|
||||
before_install:
|
||||
# Using compiler above sets CC to an invalid value, so unset it
|
||||
- unset CC
|
||||
|
||||
# We want to always allow newer versions of packages when building on GHC HEAD
|
||||
- CABALARGS=""
|
||||
- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
|
||||
|
||||
# Download and unpack the stack executable
|
||||
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH
|
||||
- mkdir -p ~/.local/bin
|
||||
- |
|
||||
if [ `uname` = "Darwin" ]
|
||||
then
|
||||
travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
|
||||
else
|
||||
travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
||||
fi
|
||||
|
||||
# Use the more reliable S3 mirror of Hackage
|
||||
#mkdir -p $HOME/.cabal
|
||||
#echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
|
||||
#echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
|
||||
|
||||
#if [ "$CABALVER" != "1.16" ]
|
||||
#then
|
||||
# echo 'jobs: $ncpus' >> $HOME/.cabal/config
|
||||
#fi
|
||||
- PKGNAME='brittany'
|
||||
- JOBS='1'
|
||||
- |
|
||||
function better_wait() {
|
||||
date
|
||||
time "$@" & # send the long living command to background!
|
||||
|
||||
set +x
|
||||
MINUTES=0
|
||||
LIMIT=30
|
||||
while kill -0 $! >/dev/null 2>&1; do
|
||||
echo -n -e " \b" # never leave evidences!
|
||||
|
||||
if [ $MINUTES == $LIMIT ]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
MINUTES=$((MINUTES+1))
|
||||
|
||||
sleep 60
|
||||
done
|
||||
wait $!
|
||||
set -x
|
||||
}
|
||||
|
||||
install:
|
||||
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
||||
- if [ -f configure.ac ]; then autoreconf -i; fi
|
||||
- |
|
||||
set -ex
|
||||
case "$BUILD" in
|
||||
stack)
|
||||
stack -j$JOBS --no-terminal --install-ghc $ARGS test --bench --only-dependencies --flag brittany:brittany-test-perf
|
||||
;;
|
||||
cabal*)
|
||||
cabal --version
|
||||
echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
||||
if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
|
||||
then
|
||||
zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >$HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
|
||||
fi
|
||||
travis_retry cabal update -v
|
||||
sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
|
||||
cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
|
||||
sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
|
||||
|
||||
# check whether current requested install-plan matches cached package-db snapshot
|
||||
if diff -u $HOME/.cabsnap/installplan.txt installplan.txt;
|
||||
then
|
||||
echo "cabal build-cache HIT";
|
||||
rm -rfv .ghc;
|
||||
cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
|
||||
cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
|
||||
else
|
||||
echo "cabal build-cache MISS";
|
||||
rm -rf $HOME/.cabsnap;
|
||||
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
|
||||
cabal install -j$JOBS --only-dependencies --enable-tests --enable-benchmarks --ghc-options="-j1 +RTS -M700M -RTS";
|
||||
fi
|
||||
|
||||
# snapshot package-db on cache miss
|
||||
if [ ! -d $HOME/.cabsnap ];
|
||||
then
|
||||
echo "snapshotting package-db to build-cache";
|
||||
mkdir $HOME/.cabsnap;
|
||||
cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
|
||||
cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
|
||||
fi
|
||||
;;
|
||||
canew)
|
||||
cabal --version
|
||||
travis_retry cabal update -v
|
||||
echo 'packages: .' > cabal.project
|
||||
echo 'package brittany' > cabal.project.local
|
||||
echo ' ghc-options: -Werror -with-rtsopts=-N1 -j1 +RTS -M700M -RTS' >> cabal.project.local
|
||||
echo ' flags: +brittany-test-perf' >> cabal.project.local
|
||||
rm -f cabal.project.freeze
|
||||
cabal new-build -j$JOBS --enable-test --enable-benchmarks --dep
|
||||
cabal new-build -j$JOBS --disable-tests --disable-benchmarks --dep
|
||||
;;
|
||||
esac
|
||||
set +ex
|
||||
|
||||
script:
|
||||
- |
|
||||
set -ex
|
||||
case "$BUILD" in
|
||||
stack)
|
||||
better_wait stack -j$JOBS --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps --ghc-options="-j1 +RTS -M700M -RTS -Werror -with-rtsopts=-N1" --flag brittany:brittany-test-perf
|
||||
;;
|
||||
cabal)
|
||||
if [ -f configure.ac ]; then autoreconf -i; fi
|
||||
cabal configure --enable-tests --enable-benchmarks -v --flags="brittany-test-perf" # -v2 provides useful information for debugging
|
||||
better_wait cabal build -j$JOBS --ghc-options="-j1 +RTS -M700M -RTS -Werror" # this builds all libraries and executables (including tests/benchmarks)
|
||||
time cabal test --ghc-options="-with-rtsopts=-N1"
|
||||
;;
|
||||
cabaldist)
|
||||
# cabal check
|
||||
cabal sdist # tests that a source-distribution can be generated
|
||||
|
||||
# Check that the resulting source distribution can be built & installed.
|
||||
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
|
||||
# `cabal install --force-reinstalls dist/*-*.tar.gz`
|
||||
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
|
||||
(cd dist && better_wait cabal install -j$JOBS --force-reinstalls "$SRC_TGZ" --ghc-options="-j1 +RTS -M700M -RTS")
|
||||
;;
|
||||
canew)
|
||||
better_wait cabal new-build -j$JOBS --disable-tests --disable-benchmarks
|
||||
better_wait cabal new-build -j$JOBS --enable-tests --enable-benchmarks
|
||||
time cabal new-test -j1
|
||||
;;
|
||||
esac
|
||||
set +ex
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"taylorfausak.purple-yolk"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"purple-yolk.brittany.command": "cabal exec -- brittany --write-mode inplace",
|
||||
"purple-yolk.ghci.command": "cabal repl --repl-options -ddump-json",
|
||||
"purple-yolk.hlint.command": "false",
|
||||
"purple-yolk.hlint.onSave": false
|
||||
}
|
42
ChangeLog.md
42
ChangeLog.md
|
@ -1,5 +1,47 @@
|
|||
# Revision history for brittany
|
||||
|
||||
## 0.14.0.0 -- November 2021
|
||||
|
||||
* #357: Added support for GHC 9.0. Dropped support for all other versions of GHC.
|
||||
* ab59e9acc3069551ac4132321b285d000f5f5691: Removed runtime dependency on `ghc-paths`.
|
||||
* fa8365a7fa9372043d5a1018f2f7669ce3853edd: Started providing pre-built binaries for Linux, MacOS, and Windows.
|
||||
* Many other changes to Brittany's internals and exposed Haskell interface, but (hopefully) no changes to its command-line interface.
|
||||
|
||||
## 0.13.1.2 -- May 2021
|
||||
|
||||
* #347: Allowed hspec 2.8. Thanks @felixonmars!
|
||||
|
||||
## 0.13.1.1 -- February 2021
|
||||
|
||||
* #333: Allowed random 1.2. Thanks @felixonmars!
|
||||
* #334: Updated Arch install instructions. Thanks @ahstro!
|
||||
* #343: Allowed ghc-exactprint 0.6.4. Thanks @maralorn!
|
||||
|
||||
## 0.13.1.0 -- December 2020
|
||||
|
||||
* #330: Started sorting imports. Thanks @expipiplus1!
|
||||
|
||||
## 0.13.0.0 -- December 2020
|
||||
|
||||
* #324: Added support for GHC 8.10.
|
||||
* Dropped support for GHC 8.4, 8.2, and 8.0.
|
||||
* Thanks @jneira, @bubba, @infinity0, and @expipiplus1!
|
||||
|
||||
## 0.12.2.0 -- November 2020
|
||||
|
||||
* #207: Fix newtype indent in associated type family.
|
||||
* #231: Improve comments-affecting-layout behaviour for tuples.
|
||||
* #259: Data declaration for newtype and records. Thanks @eborden!
|
||||
* #263: Fix non-idempotent newlines with comment + where.
|
||||
* #273: Error handling.
|
||||
* #281: Fix moving comment in export list (haddock header).
|
||||
* #286: Fix comments in instance/type instances.
|
||||
* #287: Add support for pattern synonyms. Thanks @RaoulHC!
|
||||
* #293: Expose main function as a module. Thanks @soareschen!
|
||||
* #303: Readme: Supports 8.8. Thanks @andys8!
|
||||
* #311: Allows aeson-1.5.*. Thanks @jkachmar!
|
||||
* #313: Nondecreasing export list formatting. Thanks @expipiplus1!
|
||||
|
||||
## 0.12.1.1 -- December 2019
|
||||
|
||||
* Bugfixes:
|
||||
|
|
28
Makefile
28
Makefile
|
@ -1,28 +0,0 @@
|
|||
.PHONY: test
|
||||
test:
|
||||
echo "test"
|
||||
stack test
|
||||
|
||||
.PHONY: test-all
|
||||
test-all:
|
||||
$(MAKE) test test-8.6.5 test-8.4.3 test-8.2.2 test-8.0.2
|
||||
|
||||
.PHONY: test-8.6.5
|
||||
test-8.6.5:
|
||||
echo "test 8.6.5"
|
||||
stack test --stack-yaml stack-8.6.5.yaml --work-dir .stack-work-8.6.5
|
||||
|
||||
.PHONY: test-8.4.3
|
||||
test-8.4.3:
|
||||
echo "test 8.4.3"
|
||||
stack test --stack-yaml stack-8.4.3.yaml --work-dir .stack-work-8.4.3
|
||||
|
||||
.PHONY: test-8.2.2
|
||||
test-8.2.2:
|
||||
echo "test 8.2.2"
|
||||
stack test --stack-yaml stack-8.2.2.yaml --work-dir .stack-work-8.2.2
|
||||
|
||||
.PHONY: test-8.0.2
|
||||
test-8.0.2:
|
||||
echo "test 8.0.2"
|
||||
stack test --stack-yaml stack-8.0.2.yaml --work-dir .stack-work-8.0.2
|
31
README.md
31
README.md
|
@ -1,4 +1,11 @@
|
|||
# brittany [](https://hackage.haskell.org/package/brittany) [](https://www.stackage.org/package/brittany) [](http://travis-ci.org/lspitzner/brittany)
|
||||
|
||||
:warning:
|
||||
This project is effectively unmaintained!
|
||||
I ([@tfausak](https://github.com/tfausak)) would recommend switching to another formatter.
|
||||
At time of writing (2022-11-11), I would suggest [Ormolu](https://github.com/tweag/ormolu).
|
||||
Or if you prefer some configuration, I would suggest [Fourmolu](https://github.com/fourmolu/fourmolu).
|
||||
|
||||
haskell source code formatter
|
||||
|
||||

|
||||
|
@ -48,7 +55,7 @@ log the size of the input, but _not_ the full input/output of requests.)
|
|||
|
||||
# Other usage notes
|
||||
|
||||
- Supports GHC versions `8.0`, `8.2`, `8.4`, `8.6`.
|
||||
- Supports GHC version `9.0.x`.
|
||||
- included in stackage with lts>=10.0 (or nightlies dating to >=2017-11-15)
|
||||
- config (file) documentation is lacking.
|
||||
- some config values can not be configured via commandline yet.
|
||||
|
@ -61,18 +68,11 @@ log the size of the input, but _not_ the full input/output of requests.)
|
|||
- via `stack`
|
||||
|
||||
~~~~.sh
|
||||
stack install brittany # --resolver lts-10.0
|
||||
stack install brittany # --resolver lts-16.31
|
||||
~~~~
|
||||
|
||||
If you use an lts that includes brittany this should just work; otherwise
|
||||
you may want to clone the repo and try again (there are several stack.yamls
|
||||
included).
|
||||
|
||||
- via `nix`:
|
||||
~~~.sh
|
||||
nix build -f release.nix # or 'nix-build -f release.nix'
|
||||
nix-env -i ./result
|
||||
~~~
|
||||
you may want to clone the repo and try again.
|
||||
|
||||
- via `cabal`
|
||||
|
||||
|
@ -96,12 +96,13 @@ log the size of the input, but _not_ the full input/output of requests.)
|
|||
(TODO: These instructions are more confusing than helpful. I am inclined
|
||||
to just remove them.)
|
||||
|
||||
- on ArchLinux via [the brittany AUR package](https://aur.archlinux.org/packages/brittany/)
|
||||
using `aura`:
|
||||
- on ArchLinux:
|
||||
~~~~.sh
|
||||
aura -A brittany
|
||||
pacman -S haskell-brittany
|
||||
~~~~
|
||||
|
||||
# Development tips
|
||||
|
||||
# Editor Integration
|
||||
|
||||
#### Sublime text
|
||||
|
@ -110,8 +111,8 @@ log the size of the input, but _not_ the full input/output of requests.)
|
|||
#### VSCode
|
||||
[This extension](https://marketplace.visualstudio.com/items?itemName=MaxGabriel.brittany)
|
||||
connects commandline `brittany` to VSCode formatting API. Thanks to @MaxGabriel.
|
||||
#### Via HIE
|
||||
[haskell-ide-engine](https://github.com/haskell/haskell-ide-engine)
|
||||
#### Via HLS
|
||||
[haskell-language-server](https://github.com/haskell/haskell-language-server)
|
||||
includes a `brittany` plugin that directly uses the brittany library.
|
||||
Relevant for any editors that properly support the language-server-protocol.
|
||||
#### Neovim / Vim 8
|
||||
|
|
443
brittany.cabal
443
brittany.cabal
|
@ -1,14 +1,15 @@
|
|||
cabal-version: 2.2
|
||||
|
||||
name: brittany
|
||||
version: 0.12.1.1
|
||||
version: 0.14.0.2
|
||||
synopsis: Haskell source code formatter
|
||||
description: {
|
||||
description:
|
||||
See <https://github.com/lspitzner/brittany/blob/master/README.md the README>.
|
||||
.
|
||||
If you are interested in the implementation, have a look at <https://github.com/lspitzner/brittany/blob/master/doc/implementation/theory.md this document>;
|
||||
.
|
||||
The implementation is documented in more detail <https://github.com/lspitzner/brittany/blob/master/doc/implementation/index.md here>.
|
||||
}
|
||||
license: AGPL-3
|
||||
license: AGPL-3.0-only
|
||||
license-file: LICENSE
|
||||
author: Lennart Spitzner
|
||||
maintainer: Lennart Spitzner <hexagoxel@hexagoxel.de>
|
||||
|
@ -16,373 +17,133 @@ copyright: Copyright (C) 2016-2019 Lennart Spitzner
|
|||
Copyright (C) 2019 PRODA LTD
|
||||
category: Language
|
||||
build-type: Simple
|
||||
cabal-version: 1.18
|
||||
homepage: https://github.com/lspitzner/brittany/
|
||||
bug-reports: https://github.com/lspitzner/brittany/issues
|
||||
extra-doc-files: {
|
||||
extra-doc-files:
|
||||
ChangeLog.md
|
||||
README.md
|
||||
doc/implementation/*.md
|
||||
}
|
||||
extra-source-files: {
|
||||
src-literatetests/*.blt
|
||||
srcinc/prelude.inc
|
||||
}
|
||||
extra-source-files:
|
||||
data/brittany.yaml
|
||||
data/*.hs
|
||||
|
||||
source-repository head {
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/lspitzner/brittany.git
|
||||
}
|
||||
|
||||
flag brittany-dev-lib
|
||||
description: set buildable false for anything but lib
|
||||
flag pedantic
|
||||
default: False
|
||||
description: Enables @-Werror@, which turns warnings into errors.
|
||||
manual: True
|
||||
|
||||
flag brittany-test-perf
|
||||
description: determines if performance test suite is enabled
|
||||
default: False
|
||||
manual: True
|
||||
common library
|
||||
build-depends:
|
||||
, aeson ^>= 2.0.1
|
||||
, base ^>= 4.15.0
|
||||
, butcher ^>= 1.3.3
|
||||
, bytestring ^>= 0.10.12
|
||||
, cmdargs ^>= 0.10.21
|
||||
, containers ^>= 0.6.4
|
||||
, czipwith ^>= 1.0.1
|
||||
, data-tree-print ^>= 0.1.0
|
||||
, deepseq ^>= 1.4.5
|
||||
, directory ^>= 1.3.6
|
||||
, extra ^>= 1.7.10
|
||||
, filepath ^>= 1.4.2
|
||||
, ghc ^>= 9.0.1
|
||||
, ghc-boot ^>= 9.0.1
|
||||
, ghc-boot-th ^>= 9.0.1
|
||||
, ghc-exactprint ^>= 0.6.4
|
||||
, monad-memo ^>= 0.5.3
|
||||
, mtl ^>= 2.2.2
|
||||
, multistate ^>= 0.8.0
|
||||
, pretty ^>= 1.1.3
|
||||
, random ^>= 1.2.1
|
||||
, safe ^>= 0.3.19
|
||||
, semigroups ^>= 0.19.2
|
||||
, strict ^>= 0.4.0
|
||||
, syb ^>= 0.7.2
|
||||
, text ^>= 1.2.5
|
||||
, transformers ^>= 0.5.6
|
||||
, uniplate ^>= 1.6.13
|
||||
, yaml ^>= 0.11.7
|
||||
default-language: Haskell2010
|
||||
ghc-options:
|
||||
-Weverything
|
||||
-Wno-all-missed-specialisations
|
||||
-Wno-incomplete-uni-patterns
|
||||
-Wno-missing-deriving-strategies
|
||||
-Wno-missing-export-lists
|
||||
-Wno-missing-import-lists
|
||||
-Wno-missing-local-signatures
|
||||
-Wno-missing-safe-haskell-mode
|
||||
-Wno-monomorphism-restriction
|
||||
-Wno-prepositive-qualified-module
|
||||
-Wno-safe
|
||||
-Wno-unsafe
|
||||
|
||||
library {
|
||||
default-language:
|
||||
Haskell2010
|
||||
hs-source-dirs:
|
||||
src
|
||||
include-dirs:
|
||||
srcinc
|
||||
exposed-modules: {
|
||||
if flag(pedantic)
|
||||
ghc-options: -Werror
|
||||
|
||||
common executable
|
||||
import: library
|
||||
|
||||
build-depends: brittany
|
||||
ghc-options:
|
||||
-rtsopts
|
||||
-threaded
|
||||
-Wno-implicit-prelude
|
||||
-Wno-unused-packages
|
||||
|
||||
library
|
||||
import: library
|
||||
|
||||
autogen-modules: Paths_brittany
|
||||
hs-source-dirs: source/library
|
||||
exposed-modules:
|
||||
Language.Haskell.Brittany
|
||||
Language.Haskell.Brittany.Internal
|
||||
Language.Haskell.Brittany.Internal.Prelude
|
||||
Language.Haskell.Brittany.Internal.PreludeUtils
|
||||
Language.Haskell.Brittany.Internal.Types
|
||||
Language.Haskell.Brittany.Internal.Utils
|
||||
Language.Haskell.Brittany.Internal.Backend
|
||||
Language.Haskell.Brittany.Internal.BackendUtils
|
||||
Language.Haskell.Brittany.Internal.Config
|
||||
Language.Haskell.Brittany.Internal.Config.Types
|
||||
Language.Haskell.Brittany.Internal.Config.Types.Instances
|
||||
Language.Haskell.Brittany.Internal.Obfuscation
|
||||
Paths_brittany
|
||||
}
|
||||
other-modules: {
|
||||
Language.Haskell.Brittany.Internal.LayouterBasics
|
||||
Language.Haskell.Brittany.Internal.Backend
|
||||
Language.Haskell.Brittany.Internal.BackendUtils
|
||||
Language.Haskell.Brittany.Internal.ExactPrintUtils
|
||||
Language.Haskell.Brittany.Internal.Layouters.Type
|
||||
Language.Haskell.Brittany.Internal.LayouterBasics
|
||||
Language.Haskell.Brittany.Internal.Layouters.DataDecl
|
||||
Language.Haskell.Brittany.Internal.Layouters.Decl
|
||||
Language.Haskell.Brittany.Internal.Layouters.Expr
|
||||
Language.Haskell.Brittany.Internal.Layouters.Stmt
|
||||
Language.Haskell.Brittany.Internal.Layouters.Pattern
|
||||
Language.Haskell.Brittany.Internal.Layouters.IE
|
||||
Language.Haskell.Brittany.Internal.Layouters.Import
|
||||
Language.Haskell.Brittany.Internal.Layouters.Module
|
||||
Language.Haskell.Brittany.Internal.Layouters.DataDecl
|
||||
Language.Haskell.Brittany.Internal.Layouters.Pattern
|
||||
Language.Haskell.Brittany.Internal.Layouters.Stmt
|
||||
Language.Haskell.Brittany.Internal.Layouters.Type
|
||||
Language.Haskell.Brittany.Internal.Obfuscation
|
||||
Language.Haskell.Brittany.Internal.ParseModule
|
||||
Language.Haskell.Brittany.Internal.Prelude
|
||||
Language.Haskell.Brittany.Internal.PreludeUtils
|
||||
Language.Haskell.Brittany.Internal.Transformations.Alt
|
||||
Language.Haskell.Brittany.Internal.Transformations.Floating
|
||||
Language.Haskell.Brittany.Internal.Transformations.Par
|
||||
Language.Haskell.Brittany.Internal.Transformations.Columns
|
||||
Language.Haskell.Brittany.Internal.Transformations.Floating
|
||||
Language.Haskell.Brittany.Internal.Transformations.Indent
|
||||
}
|
||||
ghc-options: {
|
||||
-Wall
|
||||
-fno-warn-unused-imports
|
||||
-fno-warn-redundant-constraints
|
||||
}
|
||||
build-depends:
|
||||
{ base >=4.9 && <4.14
|
||||
, ghc >=8.0.1 && <8.9
|
||||
, ghc-paths >=0.1.0.9 && <0.2
|
||||
, ghc-exactprint >=0.5.8 && <0.6.3
|
||||
, transformers >=0.5.2.0 && <0.6
|
||||
, containers >=0.5.7.1 && <0.7
|
||||
, mtl >=2.2.1 && <2.3
|
||||
, text >=1.2 && <1.3
|
||||
, multistate >=0.7.1.1 && <0.9
|
||||
, syb >=0.6 && <0.8
|
||||
, data-tree-print
|
||||
, pretty >=1.1.3.3 && <1.2
|
||||
, bytestring >=0.10.8.1 && <0.11
|
||||
, directory >=1.2.6.2 && <1.4
|
||||
, butcher >=1.3.1 && <1.4
|
||||
, yaml >=0.8.18 && <0.12
|
||||
, aeson >=1.0.1.0 && <1.5
|
||||
, extra >=1.4.10 && <1.8
|
||||
, uniplate >=1.6.12 && <1.7
|
||||
, strict >=0.3.2 && <0.4
|
||||
, monad-memo >=0.4.1 && <0.6
|
||||
, unsafe >=0.0 && <0.1
|
||||
, safe >=0.3.9 && <0.4
|
||||
, deepseq >=1.4.2.0 && <1.5
|
||||
, semigroups >=0.18.2 && <0.20
|
||||
, cmdargs >=0.10.14 && <0.11
|
||||
, czipwith >=1.0.1.0 && <1.1
|
||||
, ghc-boot-th >=8.0.1 && <8.9
|
||||
, filepath >=1.4.1.0 && <1.5
|
||||
, random >= 1.1 && <1.2
|
||||
}
|
||||
default-extensions: {
|
||||
CPP
|
||||
|
||||
NoImplicitPrelude
|
||||
|
||||
GADTs
|
||||
|
||||
FlexibleContexts
|
||||
FlexibleInstances
|
||||
ScopedTypeVariables
|
||||
MonadComprehensions
|
||||
LambdaCase
|
||||
MultiWayIf
|
||||
KindSignatures
|
||||
}
|
||||
}
|
||||
Language.Haskell.Brittany.Internal.Transformations.Par
|
||||
Language.Haskell.Brittany.Internal.Types
|
||||
Language.Haskell.Brittany.Internal.Utils
|
||||
Language.Haskell.Brittany.Main
|
||||
Paths_brittany
|
||||
|
||||
executable brittany
|
||||
if flag(brittany-dev-lib) {
|
||||
buildable: False
|
||||
} else {
|
||||
buildable: True
|
||||
}
|
||||
import: executable
|
||||
|
||||
hs-source-dirs: source/executable
|
||||
main-is: Main.hs
|
||||
other-modules: {
|
||||
Paths_brittany
|
||||
}
|
||||
-- other-extensions:
|
||||
|
||||
test-suite brittany-test-suite
|
||||
import: executable
|
||||
|
||||
build-depends:
|
||||
{ brittany
|
||||
, base
|
||||
, ghc
|
||||
, ghc-paths
|
||||
, ghc-exactprint
|
||||
, transformers
|
||||
, containers
|
||||
, mtl
|
||||
, text
|
||||
, multistate
|
||||
, syb
|
||||
, data-tree-print
|
||||
, pretty
|
||||
, bytestring
|
||||
, directory
|
||||
, butcher
|
||||
, yaml
|
||||
, aeson
|
||||
, extra
|
||||
, uniplate
|
||||
, strict
|
||||
, monad-memo
|
||||
, unsafe
|
||||
, safe
|
||||
, deepseq
|
||||
, semigroups
|
||||
, cmdargs
|
||||
, czipwith
|
||||
, ghc-boot-th
|
||||
, filepath >=1.4.1.0 && <1.5
|
||||
}
|
||||
hs-source-dirs: src-brittany
|
||||
include-dirs: srcinc
|
||||
default-language: Haskell2010
|
||||
default-extensions: {
|
||||
CPP
|
||||
|
||||
NoImplicitPrelude
|
||||
|
||||
GADTs
|
||||
|
||||
FlexibleContexts
|
||||
FlexibleInstances
|
||||
ScopedTypeVariables
|
||||
MonadComprehensions
|
||||
LambdaCase
|
||||
MultiWayIf
|
||||
KindSignatures
|
||||
}
|
||||
ghc-options: {
|
||||
-Wall
|
||||
-fno-spec-constr
|
||||
-fno-warn-unused-imports
|
||||
-fno-warn-redundant-constraints
|
||||
-rtsopts
|
||||
-with-rtsopts "-M2G"
|
||||
}
|
||||
|
||||
test-suite unittests
|
||||
if flag(brittany-dev-lib) || !flag(brittany-test-perf) {
|
||||
buildable: False
|
||||
} else {
|
||||
buildable: True
|
||||
}
|
||||
type: exitcode-stdio-1.0
|
||||
default-language: Haskell2010
|
||||
build-depends:
|
||||
{ brittany
|
||||
, base
|
||||
, ghc
|
||||
, ghc-paths
|
||||
, ghc-exactprint
|
||||
, transformers
|
||||
, containers
|
||||
, mtl
|
||||
, text
|
||||
, multistate
|
||||
, syb
|
||||
, data-tree-print
|
||||
, pretty
|
||||
, bytestring
|
||||
, directory
|
||||
, butcher
|
||||
, yaml
|
||||
, aeson
|
||||
, extra
|
||||
, uniplate
|
||||
, strict
|
||||
, monad-memo
|
||||
, unsafe
|
||||
, safe
|
||||
, deepseq
|
||||
, semigroups
|
||||
, cmdargs
|
||||
, czipwith
|
||||
, ghc-boot-th
|
||||
, hspec >=2.4.1 && <2.8
|
||||
}
|
||||
main-is: TestMain.hs
|
||||
other-modules: TestUtils
|
||||
AsymptoticPerfTests
|
||||
hs-source-dirs: src-unittests
|
||||
include-dirs: srcinc
|
||||
default-extensions: {
|
||||
CPP
|
||||
|
||||
NoImplicitPrelude
|
||||
|
||||
GADTs
|
||||
|
||||
FlexibleContexts
|
||||
FlexibleInstances
|
||||
ScopedTypeVariables
|
||||
MonadComprehensions
|
||||
LambdaCase
|
||||
MultiWayIf
|
||||
KindSignatures
|
||||
}
|
||||
ghc-options: {
|
||||
-Wall
|
||||
-fno-warn-unused-imports
|
||||
-rtsopts
|
||||
-with-rtsopts "-M2G"
|
||||
-threaded
|
||||
-- ^ threaded is not necessary at all, but our CI trusts on being able
|
||||
-- to pass -N1, which is not possible without threaded :-/
|
||||
-- (plus -no-threaded is not a thing, afaict)
|
||||
}
|
||||
|
||||
test-suite littests
|
||||
if flag(brittany-dev-lib) {
|
||||
buildable: False
|
||||
} else {
|
||||
buildable: True
|
||||
}
|
||||
type: exitcode-stdio-1.0
|
||||
default-language: Haskell2010
|
||||
build-depends:
|
||||
{ brittany
|
||||
, base
|
||||
, ghc
|
||||
, ghc-paths
|
||||
, ghc-exactprint
|
||||
, transformers
|
||||
, containers
|
||||
, mtl
|
||||
, text
|
||||
, multistate
|
||||
, syb
|
||||
, data-tree-print
|
||||
, pretty
|
||||
, bytestring
|
||||
, directory
|
||||
, butcher
|
||||
, yaml
|
||||
, aeson
|
||||
, extra
|
||||
, uniplate
|
||||
, strict
|
||||
, monad-memo
|
||||
, unsafe
|
||||
, safe
|
||||
, deepseq
|
||||
, semigroups
|
||||
, cmdargs
|
||||
, czipwith
|
||||
, ghc-boot-th
|
||||
, hspec >=2.4.1 && <2.8
|
||||
, filepath
|
||||
, parsec >=3.1.11 && <3.2
|
||||
}
|
||||
, hspec ^>= 2.8.3
|
||||
hs-source-dirs: source/test-suite
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
hs-source-dirs: src-literatetests
|
||||
include-dirs: srcinc
|
||||
default-extensions: {
|
||||
CPP
|
||||
|
||||
NoImplicitPrelude
|
||||
|
||||
GADTs
|
||||
|
||||
FlexibleContexts
|
||||
FlexibleInstances
|
||||
ScopedTypeVariables
|
||||
MonadComprehensions
|
||||
LambdaCase
|
||||
MultiWayIf
|
||||
KindSignatures
|
||||
}
|
||||
ghc-options: {
|
||||
-Wall
|
||||
-fno-warn-unused-imports
|
||||
-threaded
|
||||
-rtsopts
|
||||
-with-rtsopts "-M2G -N"
|
||||
}
|
||||
|
||||
test-suite libinterfacetests
|
||||
if flag(brittany-dev-lib) {
|
||||
buildable: False
|
||||
} else {
|
||||
buildable: True
|
||||
}
|
||||
type: exitcode-stdio-1.0
|
||||
default-language: Haskell2010
|
||||
build-depends:
|
||||
{ brittany
|
||||
, base
|
||||
, text
|
||||
, transformers
|
||||
, hspec >=2.4.1 && <2.8
|
||||
}
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
hs-source-dirs: src-libinterfacetests
|
||||
include-dirs: srcinc
|
||||
default-extensions: {
|
||||
FlexibleContexts
|
||||
FlexibleInstances
|
||||
ScopedTypeVariables
|
||||
MonadComprehensions
|
||||
LambdaCase
|
||||
MultiWayIf
|
||||
KindSignatures
|
||||
}
|
||||
ghc-options: {
|
||||
-Wall
|
||||
-fno-warn-unused-imports
|
||||
-rtsopts
|
||||
-with-rtsopts "-M2G"
|
||||
-threaded
|
||||
-- ^ threaded is not necessary at all, but our CI trusts on being able
|
||||
-- to pass -N1, which is not possible without threaded :-/
|
||||
-- (plus -no-threaded is not a thing, afaict)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
conf_layout:
|
||||
lconfig_columnAlignMode:
|
||||
tag: ColumnAlignModeDisabled
|
||||
lconfig_indentPolicy: IndentPolicyLeft
|
|
@ -0,0 +1,9 @@
|
|||
packages: .
|
||||
|
||||
allow-newer:
|
||||
-- https://github.com/lspitzner/butcher/issues/7
|
||||
, butcher:base
|
||||
-- https://github.com/lspitzner/data-tree-print/pull/2
|
||||
, data-tree-print:base
|
||||
-- https://github.com/lspitzner/multistate/pull/8
|
||||
, multistate:base
|
|
@ -0,0 +1 @@
|
|||
func :: a -> a
|
|
@ -0,0 +1,3 @@
|
|||
func
|
||||
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
-> (lakjsdlkjasldkj -> lakjsdlkjasldkj)
|
|
@ -0,0 +1 @@
|
|||
func = klajsdas klajsdas klajsdas
|
|
@ -0,0 +1,3 @@
|
|||
func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
@ -0,0 +1,3 @@
|
|||
func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas
|
||||
lakjsdlajsdljas
|
||||
lakjsdlajsdljas
|
|
@ -0,0 +1 @@
|
|||
func = (1 +)
|
|
@ -0,0 +1 @@
|
|||
func = (+ 1)
|
|
@ -0,0 +1 @@
|
|||
func = (1 `abc`)
|
|
@ -0,0 +1 @@
|
|||
func = (`abc` 1)
|
|
@ -0,0 +1 @@
|
|||
func = (abc, def)
|
|
@ -0,0 +1 @@
|
|||
func = (abc, )
|
|
@ -0,0 +1 @@
|
|||
func = (, abc)
|
|
@ -0,0 +1,3 @@
|
|||
func
|
||||
:: (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lakjsdlkjasldkj)
|
||||
-> lakjsdlkjasldkj
|
|
@ -0,0 +1,6 @@
|
|||
myTupleSection =
|
||||
( verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargefirstelement
|
||||
,
|
||||
, verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargethirdelement
|
||||
,
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
func =
|
||||
( lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
, lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
)
|
|
@ -0,0 +1,6 @@
|
|||
foo = if True
|
||||
then
|
||||
-- iiiiii
|
||||
"a "
|
||||
else
|
||||
"b "
|
|
@ -0,0 +1,5 @@
|
|||
func = if cond
|
||||
then pure 42
|
||||
else do
|
||||
-- test
|
||||
abc
|
|
@ -0,0 +1,3 @@
|
|||
func = case x of
|
||||
False -> False
|
||||
True -> True
|
|
@ -0,0 +1,7 @@
|
|||
func =
|
||||
case
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
of
|
||||
False -> False
|
||||
True -> True
|
|
@ -0,0 +1,7 @@
|
|||
func = do
|
||||
case
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
of
|
||||
False -> False
|
||||
True -> True
|
|
@ -0,0 +1 @@
|
|||
func = case x of {}
|
|
@ -0,0 +1,5 @@
|
|||
func =
|
||||
case
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
of {}
|
|
@ -0,0 +1,5 @@
|
|||
func = do
|
||||
case
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||
of {}
|
|
@ -0,0 +1,5 @@
|
|||
func
|
||||
:: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
)
|
||||
-> lakjsdlkjasldkj
|
|
@ -0,0 +1,3 @@
|
|||
func = do
|
||||
stmt
|
||||
stmt
|
|
@ -0,0 +1,3 @@
|
|||
func = do
|
||||
x <- stmt
|
||||
stmt x
|
|
@ -0,0 +1,3 @@
|
|||
func = do
|
||||
let x = 13
|
||||
stmt x
|
|
@ -0,0 +1,7 @@
|
|||
func =
|
||||
foooooo
|
||||
$ [ case
|
||||
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|
||||
of
|
||||
_ -> True
|
||||
]
|
|
@ -0,0 +1,4 @@
|
|||
testMethod foo bar baz qux =
|
||||
let x = undefined foo bar baz qux qux baz bar :: String
|
||||
-- some comment explaining the in expression
|
||||
in undefined foo x :: String
|
|
@ -0,0 +1,4 @@
|
|||
testMethod foo bar baz qux =
|
||||
let x = undefined :: String
|
||||
-- some comment explaining the in expression
|
||||
in undefined :: String
|
|
@ -0,0 +1,3 @@
|
|||
testMethod foo bar baz qux =
|
||||
-- some comment explaining the in expression
|
||||
let x = undefined :: String in undefined :: String
|
|
@ -0,0 +1,6 @@
|
|||
foo foo bar baz qux =
|
||||
let a = 1
|
||||
b = 2
|
||||
c = 3
|
||||
-- some comment explaining the in expression
|
||||
in undefined :: String
|
|
@ -0,0 +1,6 @@
|
|||
func =
|
||||
foo
|
||||
$ [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||
]
|
||||
++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc]
|
|
@ -0,0 +1 @@
|
|||
module Main where
|
|
@ -0,0 +1,5 @@
|
|||
func
|
||||
:: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
)
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
module Main () where
|
|
@ -0,0 +1 @@
|
|||
module Main (main) where
|
|
@ -0,0 +1 @@
|
|||
module Main (main, test1, test2) where
|
|
@ -0,0 +1,12 @@
|
|||
module Main
|
||||
( main
|
||||
, test1
|
||||
, test2
|
||||
, test3
|
||||
, test4
|
||||
, test5
|
||||
, test6
|
||||
, test7
|
||||
, test8
|
||||
, test9
|
||||
) where
|
|
@ -0,0 +1,12 @@
|
|||
module Main
|
||||
( main
|
||||
-- main
|
||||
, test1
|
||||
, test2
|
||||
-- Test 3
|
||||
, test3
|
||||
, test4
|
||||
-- Test 5
|
||||
, test5
|
||||
-- Test 6
|
||||
) where
|
|
@ -0,0 +1 @@
|
|||
module Main (Test(..)) where
|
|
@ -0,0 +1 @@
|
|||
module Main (module Main) where
|
|
@ -0,0 +1 @@
|
|||
module Main (Test(Test, a, b)) where
|
|
@ -0,0 +1,6 @@
|
|||
-- comment1
|
||||
module Main
|
||||
( Test(Test, a, b)
|
||||
, foo -- comment2
|
||||
) -- comment3
|
||||
where
|
|
@ -0,0 +1 @@
|
|||
module Main (Test()) where
|
|
@ -0,0 +1 @@
|
|||
func :: asd -> Either a b
|
|
@ -0,0 +1 @@
|
|||
-- Intentionally left empty
|
|
@ -0,0 +1 @@
|
|||
import Data.List
|
|
@ -0,0 +1 @@
|
|||
import Data.List as L
|
|
@ -0,0 +1 @@
|
|||
import qualified Data.List
|
|
@ -0,0 +1 @@
|
|||
import qualified Data.List as L
|
|
@ -0,0 +1 @@
|
|||
import safe Data.List as L
|
|
@ -0,0 +1 @@
|
|||
import {-# SOURCE #-} Data.List ( )
|
|
@ -0,0 +1 @@
|
|||
import safe qualified Data.List
|
|
@ -0,0 +1 @@
|
|||
import {-# SOURCE #-} safe qualified Data.List
|
|
@ -0,0 +1 @@
|
|||
import qualified "base" Data.List
|
|
@ -0,0 +1,5 @@
|
|||
func
|
||||
:: asd
|
||||
-> Either
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
@ -0,0 +1,3 @@
|
|||
import {-# SOURCE #-} safe qualified "base" Data.List as L
|
||||
import {-# SOURCE #-} safe qualified "base" Data.List ( )
|
||||
import {-# SOURCE #-} safe qualified Data.List hiding ( )
|
|
@ -0,0 +1 @@
|
|||
import qualified Data.List ( )
|
|
@ -0,0 +1 @@
|
|||
import Data.List ( nub )
|
|
@ -0,0 +1,4 @@
|
|||
import Data.List ( foldl'
|
||||
, indexElem
|
||||
, nub
|
||||
)
|
|
@ -0,0 +1,14 @@
|
|||
import Test ( Long
|
||||
, anymore
|
||||
, fit
|
||||
, items
|
||||
, line
|
||||
, list
|
||||
, not
|
||||
, onA
|
||||
, quite
|
||||
, single
|
||||
, that
|
||||
, will
|
||||
, with
|
||||
)
|
|
@ -0,0 +1,11 @@
|
|||
import Test ( (+)
|
||||
, (:!)(..)
|
||||
, (:*)((:.), T7, t7)
|
||||
, (:.)
|
||||
, T
|
||||
, T2()
|
||||
, T3(..)
|
||||
, T4(T4)
|
||||
, T5(T5, t5)
|
||||
, T6((<|>))
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
import Test hiding ( )
|
||||
import Test as T
|
||||
hiding ( )
|
|
@ -0,0 +1,13 @@
|
|||
import Prelude as X
|
||||
hiding ( head
|
||||
, init
|
||||
, last
|
||||
, maximum
|
||||
, minimum
|
||||
, pred
|
||||
, read
|
||||
, readFile
|
||||
, succ
|
||||
, tail
|
||||
, undefined
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
import TestJustAbitToLongModuleNameLikeThisOneIs
|
||||
( )
|
||||
import TestJustShortEnoughModuleNameLikeThisOne ( )
|
|
@ -0,0 +1,3 @@
|
|||
import TestJustAbitToLongModuleNameLikeThisOneI
|
||||
as T
|
||||
import TestJustShortEnoughModuleNameLikeThisOn as T
|
|
@ -0,0 +1,6 @@
|
|||
func
|
||||
:: asd
|
||||
-> Trither
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
@ -0,0 +1,3 @@
|
|||
import TestJustAbitToLongModuleNameLikeTh
|
||||
hiding ( )
|
||||
import TestJustShortEnoughModuleNameLike hiding ( )
|
|
@ -0,0 +1,10 @@
|
|||
import MoreThanSufficientlyLongModuleNameWithSome
|
||||
( compact
|
||||
, fit
|
||||
, inA
|
||||
, items
|
||||
, layout
|
||||
, not
|
||||
, that
|
||||
, will
|
||||
)
|
|
@ -0,0 +1,11 @@
|
|||
import TestJustAbitToLongModuleNameLikeTh
|
||||
hiding ( abc
|
||||
, def
|
||||
, ghci
|
||||
, jklm
|
||||
)
|
||||
import TestJustShortEnoughModuleNameLike hiding ( abc
|
||||
, def
|
||||
, ghci
|
||||
, jklm
|
||||
)
|
|
@ -0,0 +1,9 @@
|
|||
import {-# SOURCE #-} safe qualified "qualifier" A hiding ( )
|
||||
import {-# SOURCE #-} safe qualified "qualifiers" A
|
||||
hiding ( )
|
||||
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAf as T
|
||||
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff ( )
|
||||
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff
|
||||
as T
|
||||
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAffe
|
||||
( )
|
|
@ -0,0 +1,7 @@
|
|||
-- Test
|
||||
import Data.List ( nub ) -- Test
|
||||
{- Test -}
|
||||
import qualified Data.List as L
|
||||
( foldl' ) {- Test -}
|
||||
-- Test
|
||||
import Test ( test )
|
|
@ -0,0 +1,4 @@
|
|||
import Test ( abc
|
||||
, def
|
||||
-- comment
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
import Test ( abc
|
||||
-- comment
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
import Test ( abc
|
||||
-- comment
|
||||
, def
|
||||
, ghi
|
||||
{- comment -}
|
||||
, jkl
|
||||
-- comment
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
import Test ( -- comment
|
||||
)
|
|
@ -0,0 +1,8 @@
|
|||
import Test ( longbindingNameThatoverflowsColum
|
||||
)
|
||||
import Test ( Long
|
||||
( List
|
||||
, Of
|
||||
, Things
|
||||
)
|
||||
)
|
|
@ -0,0 +1,6 @@
|
|||
func
|
||||
:: Trither
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||
-> asd
|
|
@ -0,0 +1,18 @@
|
|||
import Test ( Thing
|
||||
( -- Comments
|
||||
)
|
||||
)
|
||||
import Test ( Thing
|
||||
( Item
|
||||
-- and Comment
|
||||
)
|
||||
)
|
||||
import Test ( Thing
|
||||
( With
|
||||
-- Comments
|
||||
, and
|
||||
-- also
|
||||
, items
|
||||
-- !
|
||||
)
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine
|
||||
( )
|
|
@ -0,0 +1,26 @@
|
|||
{-# LANGUAGE BangPatterns #-}
|
||||
{-
|
||||
- Test module
|
||||
-}
|
||||
module Test
|
||||
( test1
|
||||
-- ^ test
|
||||
, test2
|
||||
-- | test
|
||||
, test3
|
||||
, test4
|
||||
, test5
|
||||
, test6
|
||||
, test7
|
||||
, test8
|
||||
, test9
|
||||
, test10
|
||||
-- Test 10
|
||||
) where
|
||||
-- Test
|
||||
import Data.List ( nub ) -- Test
|
||||
{- Test -}
|
||||
import qualified Data.List as L
|
||||
( foldl' ) {- Test -}
|
||||
-- Test
|
||||
import Test ( test )
|
|
@ -0,0 +1,2 @@
|
|||
import Aaa
|
||||
import Baa
|
|
@ -0,0 +1,5 @@
|
|||
import Zaa
|
||||
import Zab
|
||||
|
||||
import Aaa
|
||||
import Baa
|
|
@ -0,0 +1,2 @@
|
|||
import Boo
|
||||
import qualified Zoo
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue