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
Hide 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:
...
@@ -49,6 +49,11 @@ data-files:
jupyterlab-ihaskell/labextension/static/*.js
jupyterlab-ihaskell/labextension/static/*.js
jupyterlab-ihaskell/labextension/static/*.json
jupyterlab-ihaskell/labextension/static/*.json
flag use-hlint
description: Include HLint support
default: True
manual: True
library
library
hs-source-dirs: src
hs-source-dirs: src
default-language: Haskell2010
default-language: Haskell2010
...
@@ -72,7 +77,6 @@ library
...
@@ -72,7 +77,6 @@ library
ghc-parser >=0.2.1,
ghc-parser >=0.2.1,
ghc-paths >=0.1,
ghc-paths >=0.1,
haskeline -any,
haskeline -any,
hlint >=1.9,
http-client >= 0.4,
http-client >= 0.4,
http-client-tls >= 0.2,
http-client-tls >= 0.2,
mtl >=2.1,
mtl >=2.1,
...
@@ -93,10 +97,6 @@ library
...
@@ -93,10 +97,6 @@ library
ipython-kernel >=0.10.2.0,
ipython-kernel >=0.10.2.0,
ghc-boot >=8.0 && <9.1
ghc-boot >=8.0 && <9.1
if impl (ghc < 8.10)
build-depends:
haskell-src-exts >=1.18
exposed-modules: IHaskell.Display
exposed-modules: IHaskell.Display
IHaskell.Convert
IHaskell.Convert
IHaskell.Convert.Args
IHaskell.Convert.Args
...
@@ -106,7 +106,6 @@ library
...
@@ -106,7 +106,6 @@ library
IHaskell.Eval.Inspect
IHaskell.Eval.Inspect
IHaskell.Eval.Evaluate
IHaskell.Eval.Evaluate
IHaskell.Eval.Info
IHaskell.Eval.Info
IHaskell.Eval.Lint
IHaskell.Eval.Parser
IHaskell.Eval.Parser
IHaskell.Eval.Hoogle
IHaskell.Eval.Hoogle
IHaskell.Eval.ParseShell
IHaskell.Eval.ParseShell
...
@@ -124,6 +123,14 @@ library
...
@@ -124,6 +123,14 @@ library
other-modules:
other-modules:
StringUtils
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
executable ihaskell
-- .hs or .lhs file containing the Main module.
-- .hs or .lhs file containing the Main module.
main-is: Main.hs
main-is: Main.hs
...
...
src/IHaskell/Eval/Evaluate.hs
View file @
180e42ba
...
@@ -68,13 +68,16 @@ import GHC hiding (Stmt, TypeSig)
...
@@ -68,13 +68,16 @@ import GHC hiding (Stmt, TypeSig)
import
IHaskell.Types
import
IHaskell.Types
import
IHaskell.IPython
import
IHaskell.IPython
import
IHaskell.Eval.Parser
import
IHaskell.Eval.Parser
import
IHaskell.Eval.Lint
import
IHaskell.Display
import
IHaskell.Display
import
qualified
IHaskell.Eval.Hoogle
as
Hoogle
import
qualified
IHaskell.Eval.Hoogle
as
Hoogle
import
IHaskell.Eval.Util
import
IHaskell.Eval.Util
import
IHaskell.BrokenPackages
import
IHaskell.BrokenPackages
import
StringUtils
(
replace
,
split
,
strip
,
rstrip
)
import
StringUtils
(
replace
,
split
,
strip
,
rstrip
)
#
ifdef
USE_HLINT
import
IHaskell.Eval.Lint
#
endif
#
if
MIN_VERSION_ghc
(
9
,
0
,
0
)
#
if
MIN_VERSION_ghc
(
9
,
0
,
0
)
import
GHC.Data.FastString
import
GHC.Data.FastString
#
elif
MIN_VERSION_ghc
(
8
,
2
,
0
)
#
elif
MIN_VERSION_ghc
(
8
,
2
,
0
)
...
@@ -351,10 +354,13 @@ evaluate kernelState code output widgetHandler = do
...
@@ -351,10 +354,13 @@ evaluate kernelState code output widgetHandler = do
updated
<-
case
errs
of
updated
<-
case
errs
of
-- Only run things if there are no parse errors.
-- Only run things if there are no parse errors.
[]
->
do
[]
->
do
#
ifdef
USE_HLINT
when
(
getLintStatus
kernelState
/=
LintOff
)
$
liftIO
$
do
when
(
getLintStatus
kernelState
/=
LintOff
)
$
liftIO
$
do
lintSuggestions
<-
lint
code
cmds
lintSuggestions
<-
lint
code
cmds
unless
(
noResults
lintSuggestions
)
$
unless
(
noResults
lintSuggestions
)
$
output
(
FinalResult
lintSuggestions
[]
[]
)
Success
output
(
FinalResult
lintSuggestions
[]
[]
)
Success
#
endif
runUntilFailure
kernelState
(
map
unloc
cmds
++
[
storeItCommand
execCount
])
runUntilFailure
kernelState
(
map
unloc
cmds
++
[
storeItCommand
execCount
])
-- Print all parse errors.
-- 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