Remove check includes option of ghc-mod check command. Now, we can pass all ghc options to ghc-mod check.
This commit is contained in:
parent
cbed907038
commit
1fb0d1d4a8
1
Check.hs
1
Check.hs
@ -25,4 +25,3 @@ check opt fileName = withGHC $ checkIt `gcatch` handleErrMsg
|
|||||||
load LoadAllTargets
|
load LoadAllTargets
|
||||||
liftIO readLog
|
liftIO readLog
|
||||||
options = ["-Wall","-fno-warn-unused-do-bind"] ++ ghcOpts opt
|
options = ["-Wall","-fno-warn-unused-do-bind"] ++ ghcOpts opt
|
||||||
++ map ("-i" ++) (checkIncludes opt)
|
|
||||||
|
@ -40,7 +40,6 @@ defaultOptions = Options {
|
|||||||
convert = toPlain
|
convert = toPlain
|
||||||
, hlintOpts = []
|
, hlintOpts = []
|
||||||
, ghcOpts = []
|
, ghcOpts = []
|
||||||
, checkIncludes = []
|
|
||||||
, operators = False
|
, operators = False
|
||||||
, packageConfs = []
|
, packageConfs = []
|
||||||
, useUserPackageConf = True
|
, useUserPackageConf = True
|
||||||
@ -65,9 +64,6 @@ argspec = [ Option "l" ["tolisp"]
|
|||||||
, Option "" ["no-user-package-conf"]
|
, Option "" ["no-user-package-conf"]
|
||||||
(NoArg (\opts -> opts{ useUserPackageConf = False }))
|
(NoArg (\opts -> opts{ useUserPackageConf = False }))
|
||||||
"do not read the user package database"
|
"do not read the user package database"
|
||||||
, Option "i" ["include"]
|
|
||||||
(ReqArg (\i opts -> opts{ checkIncludes = i : checkIncludes opts }) "include")
|
|
||||||
"directory to include in search for modules"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
parseArgs :: [OptDescr (Options -> Options)] -> [String] -> (Options, [String])
|
parseArgs :: [OptDescr (Options -> Options)] -> [String] -> (Options, [String])
|
||||||
|
1
Types.hs
1
Types.hs
@ -14,7 +14,6 @@ data Options = Options {
|
|||||||
convert :: [String] -> String
|
convert :: [String] -> String
|
||||||
, hlintOpts :: [String]
|
, hlintOpts :: [String]
|
||||||
, ghcOpts :: [String]
|
, ghcOpts :: [String]
|
||||||
, checkIncludes :: [String]
|
|
||||||
, operators :: Bool
|
, operators :: Bool
|
||||||
, packageConfs :: [FilePath]
|
, packageConfs :: [FilePath]
|
||||||
, useUserPackageConf :: Bool
|
, useUserPackageConf :: Bool
|
||||||
|
@ -17,13 +17,6 @@
|
|||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defcustom ghc-flymake-check-includes nil
|
|
||||||
"list of directories to include when checking file"
|
|
||||||
:type '(repeat string)
|
|
||||||
;; :risky nil
|
|
||||||
:require 'ghc-flymake
|
|
||||||
:group 'ghc-flymake)
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defconst ghc-error-buffer-name "*GHC Errors*")
|
(defconst ghc-error-buffer-name "*GHC Errors*")
|
||||||
@ -54,9 +47,8 @@
|
|||||||
(if ghc-flymake-command
|
(if ghc-flymake-command
|
||||||
(let ((hopts (ghc-mapconcat (lambda (x) (list "-h" x)) ghc-hlint-options)))
|
(let ((hopts (ghc-mapconcat (lambda (x) (list "-h" x)) ghc-hlint-options)))
|
||||||
`(,@hopts "lint" ,file))
|
`(,@hopts "lint" ,file))
|
||||||
(let ((gopts (ghc-mapconcat (lambda (x) (list "-g" x)) ghc-ghc-options))
|
(let ((gopts (ghc-mapconcat (lambda (x) (list "-g" x)) ghc-ghc-options)))
|
||||||
(includes (ghc-mapconcat (lambda (x) (list "-i" x)) ghc-flymake-check-includes)))
|
`(,@gopts "check" ,file))))
|
||||||
`(,@gopts "check" ,@includes ,file))))
|
|
||||||
|
|
||||||
(defun ghc-flymake-toggle-command ()
|
(defun ghc-flymake-toggle-command ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
Loading…
Reference in New Issue
Block a user