Skip to content

Commit 4e82134

Browse files
committed
Merge branch 'master' into explicit-fixity
2 parents 2547212 + 344323b commit 4e82134

File tree

82 files changed

+2551
-1241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2551
-1241
lines changed

.github/workflows/hlint.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '**'
77

88
jobs:
9-
build10:
9+
hlint:
1010
name: "Hlint check run"
1111
runs-on: ubuntu-latest
1212
steps:
@@ -15,11 +15,12 @@ jobs:
1515
- name: 'Installing'
1616
uses: rwe/actions-hlint-setup@v1
1717
with:
18-
version: '3.3.4'
18+
version: '3.4'
1919

2020
- name: 'Checking code'
2121
uses: rwe/actions-hlint-run@v1
2222
with:
23-
hlint-bin: "hlint --with-group=extra --hint=ghcide/.hlint.yaml"
24-
path: '[ "ghcide/src", "ghcide/exe", "ghcide/bench/lib", "ghcide/bench/exe", "ghcide/bench/hist", "shake-bench/src", "ghcide/test/exe"]'
23+
hlint-bin: "hlint --with-group=extra"
24+
fail-on: error
25+
path: .
2526

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ test/testdata/**/hie.yaml
3030
# shake build folder (used in benchmark suite)
3131
.shake/
3232

33-
# pre-commit-hook.nix
34-
.pre-commit-config.yaml
35-
3633
# direnv
3734
/.direnv/
3835
/.envrc

.gitpod.Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM gitpod/workspace-full
2+
3+
RUN sudo install-packages build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 \
4+
libncurses-dev libncurses5 libtinfo5 && \
5+
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
6+
BOOTSTRAP_HASKELL_MINIMAL=1 \
7+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && \
8+
echo 'source $HOME/.ghcup/env' >> $HOME/.bashrc && \
9+
echo 'export PATH=$HOME/.cabal/bin:$HOME/.local/bin:$PATH' >> $HOME/.bashrc && \
10+
. /home/gitpod/.ghcup/env && \
11+
ghcup install ghc --set && \
12+
ghcup install hls --set && \
13+
ghcup install cabal --set && \
14+
ghcup install stack --set && \
15+
cabal update && \
16+
cabal install stylish-haskell hoogle implicit-hie && \
17+
pip install pre-commit && \
18+
npm install -g http-server

.gitpod.yml

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,54 @@
1+
image:
2+
file: .gitpod.Dockerfile
13
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
24
tasks:
3-
- before: |
4-
# Only the /workspace folder is persistent
5-
export XDG_DATA_HOME=/workspace/.local/share
6-
export XDG_CONFIG_HOME=/workspace/.local/config
7-
export XDG_STATE_HOME=/workspace/.local/state
8-
export XDG_CACHE_HOME=/workspace/.cache
9-
export CABAL_DIR=/workspace/.cabal
10-
export STACK_ROOT=/workspace/.stack
5+
- name: Setup
6+
before: |
7+
# Make sure some folders not in /workspace persist between worksapce restarts.
8+
# You may add additional directories to this list.
9+
declare -a CACHE_DIRS=(
10+
$HOME/.local
11+
$HOME/.cabal
12+
$HOME/.stack
13+
$HOME/.ghcup
14+
/nix
15+
)
16+
for DIR in "${CACHE_DIRS[@]}"; do
17+
mkdir -p $(dirname /workspace/cache$DIR)
18+
mkdir -p $DIR # in case $DIR doesn't already exist
19+
# On a fresh start with no prebuilds, we move existing directory
20+
# to /workspace. 'sudo mv' fails with 'no permission', I don't know why
21+
if [ ! -d /workspace/cache$DIR ]; then
22+
sudo cp -rp $DIR /workspace/cache$DIR
23+
sudo rm -rf $DIR/*
24+
fi
25+
mkdir -p /workspace/cache$DIR # make sure it exists even if cp fails
26+
# Now /workspace/cache$DIR exists.
27+
# Use bind mount to make $DIR backed by /workspace/cache$DIR
28+
sudo mount --bind /workspace/cache$DIR $DIR
29+
done
1130
12-
# install ghcup, ghc and cabal
13-
export GHCUP_INSTALL_BASE_PREFIX=/workspace
14-
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
15-
export BOOTSTRAP_HASKELL_MINIMAL=1
16-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
17-
/workspace/.ghcup/bin/ghcup install ghc --set
18-
/workspace/.ghcup/bin/ghcup install cabal
19-
20-
# Add ghcup binaries to the PATH since VSCode does not see 'source .ghcup/env'
21-
pushd /usr/local/bin
22-
sudo ln -s /workspace/.ghcup/bin/* /usr/local/bin
23-
popd
24-
25-
# Fix the Cabal dir since VSCode does not see CABAL_DIR
26-
cabal update
27-
echo "Symlinking /workspace/.cabal to ~/.cabal"
28-
ln -s /workspace/.cabal ~
31+
# Install pre-commit hook
32+
pre-commit install
2933
3034
# Configure VSCode to use the locally built version of HLS
3135
mkdir -p .vscode
32-
echo '{ "haskell.serverExecutablePath": "/workspace/.cabal/bin/haskell-language-server" }' > .vscode/settings.json
36+
if [ ! -f .vscode/settings.json ]; then
37+
# Only write to .vscode/settings.json if it doesn't exist.
38+
echo '{' > .vscode/settings.json
39+
echo ' "haskell.serverExecutablePath": "/home/gitpod/.cabal/bin/haskell-language-server",' >> .vscode/settings.json
40+
echo ' "haskell.formattingProvider": "stylish-haskell"' >> .vscode/settings.json
41+
echo '}' >> .vscode/settings.json
42+
fi
3343
34-
init: |
44+
pushd docs
45+
pip install -r requirements.txt
46+
popd
47+
init: |
48+
cabal update
3549
cabal configure --enable-executable-dynamic
36-
cabal build --enable-tests
37-
cabal install exe:haskell-language-server
38-
command: |
39-
cabal build --enable-tests
50+
cabal build --enable-tests all
51+
cabal install exe:haskell-language-server
4052
4153
# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
4254
ports: []
@@ -62,4 +74,4 @@ vscode:
6274
extensions:
6375
- "haskell.haskell"
6476
- "justusadam.language-haskell"
65-
- "usernamehw.errorlens"
77+
- "EditorConfig.EditorConfig"

.hlint.yaml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# HLint configuration file
2+
# https://github.com/ndmitchell/hlint
3+
##########################
4+
5+
# To run HLint do:
6+
# $ hlint --git -j4
7+
8+
# Warnings currently triggered by our code
9+
- ignore: {name: "Use <$>"}
10+
- ignore: {name: "Use :"}
11+
- ignore: {name: "Redundant do"}
12+
- ignore: {name: "Avoid lambda"}
13+
- ignore: {name: "Use newtype instead of data"}
14+
- ignore: {name: "Use unless"}
15+
- ignore: {name: "Move brackets to avoid $"}
16+
- ignore: {name: "Eta reduce"}
17+
- ignore: {name: "Parse error"}
18+
- ignore: {name: "Reduce duplication"}
19+
- ignore: {name: "Use ++"}
20+
- ignore: {name: "Use $>"}
21+
- ignore: {name: "Use section"}
22+
- ignore: {name: "Use record patterns"}
23+
- ignore: {name: "Use camelCase"}
24+
- ignore: {name: "Use uncurry"}
25+
- ignore: {name: "Avoid lambda using `infix`"}
26+
27+
# Gives at least one suggestion we don't like.
28+
- ignore: {name: "Use <=<"}
29+
- ignore: {name: "Use zipFrom"}
30+
- ignore: {name: "Use zipWithFrom"}
31+
32+
# We are using the "redundant" return/pure to assign a name. We do not want to
33+
# delete it. In particular, this is not an improvement:
34+
# Found:
35+
# do options <- somethingComplicated
36+
# pure options
37+
# Perhaps:
38+
# do somethingComplicated
39+
- ignore: {name: "Redundant return"}
40+
- ignore: {name: "Redundant pure"}
41+
42+
# Off by default hints we like
43+
- warn: {name: Use module export list}
44+
45+
# Condemn nub and friends
46+
- warn: {lhs: nub (sort x), rhs: Data.List.Extra.nubSort x}
47+
- warn: {lhs: nub, rhs: Data.List.Extra.nubOrd}
48+
- warn: {lhs: nubBy, rhs: Data.List.Extra.nubOrdBy}
49+
- warn: {lhs: Data.List.Extra.nubOn, rhs: Data.List.Extra.nubOrdOn}
50+
51+
- functions:
52+
# Things that are unsafe in Haskell base library
53+
- name: unsafePerformIO
54+
within:
55+
- Development.IDE.Core.Shake
56+
- Development.IDE.GHC.Util
57+
- Development.IDE.Graph.Internal.Database
58+
- Development.IDE.Graph.Internal.Paths
59+
- Development.IDE.Graph.Internal.Profile
60+
- Ide.Types
61+
- Test.Hls
62+
- Test.Hls.Command
63+
- Wingman.Debug
64+
- Wingman.Types
65+
- AutoTupleSpec
66+
- name: unsafeInterleaveIO
67+
within:
68+
- Development.IDE.LSP.LanguageServer
69+
- {name: unsafeDupablePerformIO, within: []}
70+
- name: unsafeCoerce
71+
within:
72+
- Ide.Plugin.Eval.Code
73+
- Development.IDE.Core.Compile
74+
- Development.IDE.Types.Shake
75+
- Wingman.Judgements.SYB
76+
- Ide.Plugin.Properties
77+
78+
# Things that are a bit dangerous in the GHC API
79+
- name: nameModule
80+
within:
81+
- Development.IDE.GHC.CoreFile
82+
- Ide.Plugin.CallHierarchy.Internal
83+
- Ide.Plugin.Rename
84+
- Compat.HieBin
85+
86+
# Partial functions
87+
- name: Data.List.head
88+
within:
89+
- Main
90+
- Experiments
91+
- Development.IDE.Plugin.CodeAction
92+
- Development.IDE.Plugin.Completions
93+
- Development.IDE.Plugin.CodeAction.ExactPrint
94+
- Development.IDE.Session
95+
- Development.IDE.Spans.Documentation
96+
- Ide.Plugin.CallHierarchy.Internal
97+
- TExpectedActual
98+
- TRigidType
99+
- TRigidType
100+
- Ide.Plugin.Class
101+
- Wingman.Tactics
102+
103+
- name: Data.List.tail
104+
within:
105+
- Main
106+
- Development.Benchmark.Rules
107+
- Development.IDE.Plugin.CodeAction
108+
- Development.IDE.Plugin.CodeAction.ExactPrint
109+
- Development.IDE.Session
110+
- IDE.Plugin.Eval.Code
111+
- IDE.Plugin.Eval.Util
112+
- UnificationSpec
113+
114+
- name: Data.List.last
115+
within:
116+
- GenChangelogs
117+
- Main
118+
119+
- name: Data.List.init
120+
within: []
121+
122+
- name: Data.List.foldl1'
123+
within: []
124+
125+
- name: Data.List.foldr1'
126+
within: []
127+
128+
- name: "Data.List.!!"
129+
within:
130+
- Main
131+
- Experiments
132+
- FunctionalCodeAction
133+
- Development.IDE.Plugin.CodeAction
134+
- Development.IDE.Plugin.Completions.Logic
135+
- Development.IDE.Spans.Documentation
136+
- Wingman.CaseSplit
137+
- Wingman.Simplify
138+
139+
- name: Data.Text.head
140+
within:
141+
- Development.IDE.Plugin.CodeAction
142+
- Development.IDE.Plugin.Completions.Logic
143+
144+
- name: Data.Foldable.foldl1
145+
within: []
146+
147+
- name: Data.Foldable.foldr1
148+
within:
149+
- Wingman.Tactics
150+
151+
- name: Data.Maybe.fromJust
152+
within:
153+
- Experiments
154+
- Main
155+
- MultipleImports
156+
- Progress
157+
- Utils
158+
- Development.IDE.Core.Compile
159+
- Development.IDE.Core.Rules
160+
- Development.IDE.Core.Shake
161+
- Development.IDE.Plugin.Completions
162+
- Development.IDE.Plugin.CodeAction.ExactPrint
163+
- Development.IDE.Test
164+
- Development.IDE.Graph.Internal.Profile
165+
- Development.IDE.Graph.Internal.Rules
166+
- Ide.Plugin.Class
167+
168+
- name: "Data.Map.!"
169+
within:
170+
- Wingman.LanguageServer
171+
172+
- name: "Data.IntMap.!"
173+
within: []
174+
175+
- name: "Data.Vector.!"
176+
within: []
177+
178+
- name: "GHC.Arr.!"
179+
within: []
180+
181+
# We really do not want novel usages of restricted functions, and mere
182+
# Warning is not enough to prevent those consistently; you need a build failure.
183+
- error: {name: Avoid restricted function}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@
4444
# Build
4545
*.nix @berberman @michaelpj @guibou
4646
*.project @jneira
47+
.gitpod.* @kokobd

cabal.project

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ optional-packages: vendored/*/*.cabal
3838
tests: true
3939

4040
package *
41-
-- ghc 8.10 cannot build ghc-lib 9.2 with --haddock
42-
-- ghc-options: -haddock
41+
ghc-options: -haddock
4342
test-show-details: direct
4443

4544
write-ghc-environment-files: never

0 commit comments

Comments
 (0)