Show expose error code in shellcheck frontends
This commit is contained in:
parent
e5e08df1d9
commit
d404bc703d
|
@ -15,7 +15,7 @@
|
||||||
You should have received a copy of the GNU Affero General Public License
|
You should have received a copy of the GNU Affero General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-}
|
-}
|
||||||
module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scMessage) where
|
module ShellCheck.Simple (shellCheck, ShellCheckComment, scLine, scColumn, scSeverity, scCode, scMessage) where
|
||||||
|
|
||||||
import ShellCheck.Parser
|
import ShellCheck.Parser
|
||||||
import ShellCheck.Analytics
|
import ShellCheck.Analytics
|
||||||
|
|
|
@ -23,6 +23,7 @@ instance JSON ShellCheckComment where
|
||||||
("line", showJSON $ scLine c),
|
("line", showJSON $ scLine c),
|
||||||
("column", showJSON $ scColumn c),
|
("column", showJSON $ scColumn c),
|
||||||
("level", showJSON $ scSeverity c),
|
("level", showJSON $ scSeverity c),
|
||||||
|
("code", showJSON $ scCode c),
|
||||||
("message", showJSON $ scMessage c)
|
("message", showJSON $ scMessage c)
|
||||||
]
|
]
|
||||||
readJSON = undefined
|
readJSON = undefined
|
||||||
|
|
|
@ -66,7 +66,9 @@ doInput filename contents colorFunc = do
|
||||||
return $ null comments
|
return $ null comments
|
||||||
|
|
||||||
cuteIndent comment =
|
cuteIndent comment =
|
||||||
(replicate ((scColumn comment) - 1) ' ') ++ "^-- " ++ (scMessage comment)
|
(replicate ((scColumn comment) - 1) ' ') ++ "^-- " ++ (code $ scCode comment) ++ ": " ++ (scMessage comment)
|
||||||
|
|
||||||
|
code code = "SC" ++ (show code)
|
||||||
|
|
||||||
getColorFunc = do
|
getColorFunc = do
|
||||||
term <- hIsTerminalDevice stdout
|
term <- hIsTerminalDevice stdout
|
||||||
|
|
Loading…
Reference in New Issue