Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
180e42ba
Commit
180e42ba
authored
Oct 09, 2021
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ihaskell: add `use-hlint` flag
parent
42a78084
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
ihaskell.cabal
ihaskell.cabal
+13
-6
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+7
-1
No files found.
ihaskell.cabal
View file @
180e42ba
...
...
@@ -49,6 +49,11 @@ data-files:
jupyterlab-ihaskell/labextension/static/*.js
jupyterlab-ihaskell/labextension/static/*.json
flag use-hlint
description: Include HLint support
default: True
manual: True
library
hs-source-dirs: src
default-language: Haskell2010
...
...
@@ -72,7 +77,6 @@ library
ghc-parser >=0.2.1,
ghc-paths >=0.1,
haskeline -any,
hlint >=1.9,
http-client >= 0.4,
http-client-tls >= 0.2,
mtl >=2.1,
...
...
@@ -93,10 +97,6 @@ library
ipython-kernel >=0.10.2.0,
ghc-boot >=8.0 && <9.1
if impl (ghc < 8.10)
build-depends:
haskell-src-exts >=1.18
exposed-modules: IHaskell.Display
IHaskell.Convert
IHaskell.Convert.Args
...
...
@@ -106,7 +106,6 @@ library
IHaskell.Eval.Inspect
IHaskell.Eval.Evaluate
IHaskell.Eval.Info
IHaskell.Eval.Lint
IHaskell.Eval.Parser
IHaskell.Eval.Hoogle
IHaskell.Eval.ParseShell
...
...
@@ -124,6 +123,14 @@ library
other-modules:
StringUtils
if flag(use-hlint)
exposed-modules: IHaskell.Eval.Lint
build-depends: hlint >=1.9
cpp-options: -DUSE_HLINT
if flag(use-hlint) && impl (ghc < 8.10)
build-depends: haskell-src-exts >=1.18
executable ihaskell
-- .hs or .lhs file containing the Main module.
main-is: Main.hs
...
...
src/IHaskell/Eval/Evaluate.hs
View file @
180e42ba
...
...
@@ -68,13 +68,16 @@ import GHC hiding (Stmt, TypeSig)
import
IHaskell.Types
import
IHaskell.IPython
import
IHaskell.Eval.Parser
import
IHaskell.Eval.Lint
import
IHaskell.Display
import
qualified
IHaskell.Eval.Hoogle
as
Hoogle
import
IHaskell.Eval.Util
import
IHaskell.BrokenPackages
import
StringUtils
(
replace
,
split
,
strip
,
rstrip
)
#
ifdef
USE_HLINT
import
IHaskell.Eval.Lint
#
endif
#
if
MIN_VERSION_ghc
(
9
,
0
,
0
)
import
GHC.Data.FastString
#
elif
MIN_VERSION_ghc
(
8
,
2
,
0
)
...
...
@@ -351,10 +354,13 @@ evaluate kernelState code output widgetHandler = do
updated
<-
case
errs
of
-- Only run things if there are no parse errors.
[]
->
do
#
ifdef
USE_HLINT
when
(
getLintStatus
kernelState
/=
LintOff
)
$
liftIO
$
do
lintSuggestions
<-
lint
code
cmds
unless
(
noResults
lintSuggestions
)
$
output
(
FinalResult
lintSuggestions
[]
[]
)
Success
#
endif
runUntilFailure
kernelState
(
map
unloc
cmds
++
[
storeItCommand
execCount
])
-- Print all parse errors.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment