Skip to content

Commit

Permalink
[#482] Add GHC options to generate the HIE files (#494)
Browse files Browse the repository at this point in the history
Resolves #482
  • Loading branch information
vrom911 authored Aug 8, 2020
1 parent 06f47a7 commit 9e3317d
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cabal.config
cabal.project.local
.ghc.environment.*
.HTF/
.hie/
# Stack
.stack-work/
stack.yaml.lock
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ The changelog is available [on GitHub][2].
Add README link in the `.cabal` file's description field.
* [#453](https://github.com/kowainik/summoner/issues/453):
Drop support of `GHC-7.10` in the generated projects.
* [#482](https://github.com/kowainik/summoner/issues/482):
Include `.hie` related GHC options to the generated files:
`-fwrite-ide-info` and `-hiedir=.hie` for GHC >= 8.8.
Also add `.hie` folder in the `.gitignore`.
* [#484](https://github.com/kowainik/summoner/issues/484):
Improve generated files content.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ Features related to the structure and content of the generated projects.
-Wmissing-export-lists (GHC ⩾ 8.4)
-Wpartial-fields (GHC ⩾ 8.4)
-Wmissing-deriving-strategies (GHC ⩾ 8.8)
-fwrite-ide-info (GHC ⩾ 8.8)
-hiedir=.hie (GHC ⩾ 8.8)
-Wunused-packages (GHC ⩾ 8.10)
```

Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/cabal-full/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cabal.config
cabal.project.local
.ghc.environment.*
.HTF/
.hie/
# Stack
.stack-work/
stack.yaml.lock
Expand Down
2 changes: 2 additions & 0 deletions summoner-cli/examples/cabal-full/cabal-full.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ common common-options
-Wpartial-fields
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies
-fwrite-ide-info
-hiedir=.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

Expand Down
2 changes: 2 additions & 0 deletions summoner-cli/examples/cabal-minimal/cabal-minimal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ common common-options
-Wpartial-fields
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies
-fwrite-ide-info
-hiedir=.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/full-batteries/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cabal.config
cabal.project.local
.ghc.environment.*
.HTF/
.hie/
# Stack
.stack-work/
stack.yaml.lock
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/examples/stack-full/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cabal.config
cabal.project.local
.ghc.environment.*
.HTF/
.hie/
# Stack
.stack-work/
stack.yaml.lock
Expand Down
2 changes: 2 additions & 0 deletions summoner-cli/examples/stack-full/stack-full.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ common common-options
-Wpartial-fields
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies
-fwrite-ide-info
-hiedir=.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

Expand Down
2 changes: 2 additions & 0 deletions summoner-cli/src/Summoner/Template/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ cabalFile Settings{..} = File (toString settingsRepo ++ ".cabal") cabalFileConte
, " -Wpartial-fields"
, " if impl(ghc >= 8.8)"
, " ghc-options: -Wmissing-deriving-strategies"
, " -fwrite-ide-info"
, " -hiedir=.hie"
, " if impl(ghc >= 8.10)"
, " ghc-options: -Wunused-packages"
]
Expand Down
1 change: 1 addition & 0 deletions summoner-cli/src/Summoner/Template/GitHub.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ gitHubFiles Settings{..} = concat
, "cabal.project.local"
, ".ghc.environment.*"
, ".HTF/"
, ".hie/"
, "# Stack"
, ".stack-work/"
, "stack.yaml.lock"
Expand Down
2 changes: 2 additions & 0 deletions summoner-cli/summoner.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ common common-options
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies
-Werror=missing-deriving-strategies
-fwrite-ide-info
-hiedir=../.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

Expand Down
2 changes: 2 additions & 0 deletions summoner-tui/summoner-tui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ common common-options
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies
-Werror=missing-deriving-strategies
-fwrite-ide-info
-hiedir=../.hie
if impl(ghc >= 8.10)
ghc-options: -Wunused-packages

Expand Down

0 comments on commit 9e3317d

Please sign in to comment.