Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Annlix
ShellCheck
提交
7630136d
S
ShellCheck
项目概览
Annlix
/
ShellCheck
与 Fork 源项目一致
Fork自
镜像 / koalaman / ShellCheck
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
ShellCheck
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7630136d
编写于
9月 12, 2013
作者:
V
Vidar Holen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move command and variable lists to ShellCheck.Data.
上级
dacb8c59
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
71 addition
and
43 deletion
+71
-43
ShellCheck.cabal
ShellCheck.cabal
+1
-1
ShellCheck/Analytics.hs
ShellCheck/Analytics.hs
+1
-40
ShellCheck/Data.hs
ShellCheck/Data.hs
+67
-0
ShellCheck/Parser.hs
ShellCheck/Parser.hs
+2
-2
未找到文件。
ShellCheck.cabal
浏览文件 @
7630136d
...
...
@@ -10,7 +10,7 @@ Cabal-Version: >= 1.2
library
build-depends: base >= 4, parsec, containers, regex-compat, mtl, directory
exposed-modules: ShellCheck.AST, ShellCheck.Parser, ShellCheck.Analytics, ShellCheck.Simple
exposed-modules: ShellCheck.AST, ShellCheck.
Data, ShellCheck.
Parser, ShellCheck.Analytics, ShellCheck.Simple
executable shellcheck
main-is: shellcheck.hs
...
...
ShellCheck/Analytics.hs
浏览文件 @
7630136d
...
...
@@ -18,6 +18,7 @@
module
ShellCheck.Analytics
where
import
ShellCheck.AST
import
ShellCheck.Data
import
ShellCheck.Parser
import
Control.Monad
import
Control.Monad.State
...
...
@@ -138,46 +139,6 @@ treeChecks = [
,
checkSingleQuotedVariables
]
internalVariables
=
[
-- Generic
"_"
,
-- Bash
"BASH"
,
"BASHOPTS"
,
"BASHPID"
,
"BASH_ALIASES"
,
"BASH_ARGC"
,
"BASH_ARGV"
,
"BASH_CMDS"
,
"BASH_COMMAND"
,
"BASH_EXECUTION_STRING"
,
"BASH_LINENO"
,
"BASH_REMATCH"
,
"BASH_SOURCE"
,
"BASH_SUBSHELL"
,
"BASH_VERSINFO"
,
"BASH_VERSION"
,
"COMP_CWORD"
,
"COMP_KEY"
,
"COMP_LINE"
,
"COMP_POINT"
,
"COMP_TYPE"
,
"COMP_WORDBREAKS"
,
"COMP_WORDS"
,
"COPROC"
,
"DIRSTACK"
,
"EUID"
,
"FUNCNAME"
,
"GROUPS"
,
"HISTCMD"
,
"HOSTNAME"
,
"HOSTTYPE"
,
"LINENO"
,
"MACHTYPE"
,
"MAPFILE"
,
"OLDPWD"
,
"OPTARG"
,
"OPTIND"
,
"OSTYPE"
,
"PIPESTATUS"
,
"PPID"
,
"PWD"
,
"RANDOM"
,
"READLINE_LINE"
,
"READLINE_POINT"
,
"REPLY"
,
"SECONDS"
,
"SHELLOPTS"
,
"SHLVL"
,
"UID"
,
"BASH_ENV"
,
"BASH_XTRACEFD"
,
"CDPATH"
,
"COLUMNS"
,
"COMPREPLY"
,
"EMACS"
,
"ENV"
,
"FCEDIT"
,
"FIGNORE"
,
"FUNCNEST"
,
"GLOBIGNORE"
,
"HISTCONTROL"
,
"HISTFILE"
,
"HISTFILESIZE"
,
"HISTIGNORE"
,
"HISTSIZE"
,
"HISTTIMEFORMAT"
,
"HOME"
,
"HOSTFILE"
,
"IFS"
,
"IGNOREEOF"
,
"INPUTRC"
,
"LANG"
,
"LC_ALL"
,
"LC_COLLATE"
,
"LC_CTYPE"
,
"LC_MESSAGES"
,
"LC_NUMERIC"
,
"LINES"
,
"MAIL"
,
"MAILCHECK"
,
"MAILPATH"
,
"OPTERR"
,
"PATH"
,
"POSIXLY_CORRECT"
,
"PROMPT_COMMAND"
,
"PROMPT_DIRTRIM"
,
"PS1"
,
"PS2"
,
"PS3"
,
"PS4"
,
"SHELL"
,
"TIMEFORMAT"
,
"TMOUT"
,
"TMPDIR"
,
"auto_resume"
,
"histchars"
,
-- Zsh
"ARGV0"
,
"BAUD"
,
"cdpath"
,
"COLUMNS"
,
"CORRECT_IGNORE"
,
"DIRSTACKSIZE"
,
"ENV"
,
"FCEDIT"
,
"fignore"
,
"fpath"
,
"histchars"
,
"HISTCHARS"
,
"HISTFILE"
,
"HISTSIZE"
,
"HOME"
,
"IFS"
,
"KEYBOARD_HACK"
,
"KEYTIMEOUT"
,
"LANG"
,
"LC_ALL"
,
"LC_COLLATE"
,
"LC_CTYPE"
,
"LC_MESSAGES"
,
"LC_NUMERIC"
,
"LC_TIME"
,
"LINES"
,
"LISTMAX"
,
"LOGCHECK"
,
"MAIL"
,
"MAILCHECK"
,
"mailpath"
,
"manpath"
,
"module_path"
,
"NULLCMD"
,
"path"
,
"POSTEDIT"
,
"PROMPT"
,
"PROMPT2"
,
"PROMPT3"
,
"PROMPT4"
,
"prompt"
,
"PROMPT_EOL_MARK"
,
"PS1"
,
"PS2"
,
"PS3"
,
"PS4"
,
"psvar"
,
"READNULLCMD"
,
"REPORTTIME"
,
"REPLY"
,
"reply"
,
"RPROMPT"
,
"RPS1"
,
"RPROMPT2"
,
"RPS2"
,
"SAVEHIST"
,
"SPROMPT"
,
"STTY"
,
"TERM"
,
"TERMINFO"
,
"TIMEFMT"
,
"TMOUT"
,
"TMPPREFIX"
,
"watch"
,
"WATCHFMT"
,
"WORDCHARS"
,
"ZBEEP"
,
"ZDOTDIR"
,
"ZLE_LINE_ABORTED"
,
"ZLE_REMOVE_SUFFIX_CHARS"
,
"ZLE_SPACE_SUFFIX_CHARS"
]
runBasicTreeAnalysis
checks
token
=
checkList
(
map
runTree
checks
)
token
...
...
ShellCheck/Data.hs
0 → 100644
浏览文件 @
7630136d
module
ShellCheck.Data
where
internalVariables
=
[
-- Generic
"_"
,
-- Bash
"BASH"
,
"BASHOPTS"
,
"BASHPID"
,
"BASH_ALIASES"
,
"BASH_ARGC"
,
"BASH_ARGV"
,
"BASH_CMDS"
,
"BASH_COMMAND"
,
"BASH_EXECUTION_STRING"
,
"BASH_LINENO"
,
"BASH_REMATCH"
,
"BASH_SOURCE"
,
"BASH_SUBSHELL"
,
"BASH_VERSINFO"
,
"BASH_VERSION"
,
"COMP_CWORD"
,
"COMP_KEY"
,
"COMP_LINE"
,
"COMP_POINT"
,
"COMP_TYPE"
,
"COMP_WORDBREAKS"
,
"COMP_WORDS"
,
"COPROC"
,
"DIRSTACK"
,
"EUID"
,
"FUNCNAME"
,
"GROUPS"
,
"HISTCMD"
,
"HOSTNAME"
,
"HOSTTYPE"
,
"LINENO"
,
"MACHTYPE"
,
"MAPFILE"
,
"OLDPWD"
,
"OPTARG"
,
"OPTIND"
,
"OSTYPE"
,
"PIPESTATUS"
,
"PPID"
,
"PWD"
,
"RANDOM"
,
"READLINE_LINE"
,
"READLINE_POINT"
,
"REPLY"
,
"SECONDS"
,
"SHELLOPTS"
,
"SHLVL"
,
"UID"
,
"BASH_ENV"
,
"BASH_XTRACEFD"
,
"CDPATH"
,
"COLUMNS"
,
"COMPREPLY"
,
"EMACS"
,
"ENV"
,
"FCEDIT"
,
"FIGNORE"
,
"FUNCNEST"
,
"GLOBIGNORE"
,
"HISTCONTROL"
,
"HISTFILE"
,
"HISTFILESIZE"
,
"HISTIGNORE"
,
"HISTSIZE"
,
"HISTTIMEFORMAT"
,
"HOME"
,
"HOSTFILE"
,
"IFS"
,
"IGNOREEOF"
,
"INPUTRC"
,
"LANG"
,
"LC_ALL"
,
"LC_COLLATE"
,
"LC_CTYPE"
,
"LC_MESSAGES"
,
"LC_NUMERIC"
,
"LINES"
,
"MAIL"
,
"MAILCHECK"
,
"MAILPATH"
,
"OPTERR"
,
"PATH"
,
"POSIXLY_CORRECT"
,
"PROMPT_COMMAND"
,
"PROMPT_DIRTRIM"
,
"PS1"
,
"PS2"
,
"PS3"
,
"PS4"
,
"SHELL"
,
"TIMEFORMAT"
,
"TMOUT"
,
"TMPDIR"
,
"auto_resume"
,
"histchars"
,
-- Zsh
"ARGV0"
,
"BAUD"
,
"cdpath"
,
"COLUMNS"
,
"CORRECT_IGNORE"
,
"DIRSTACKSIZE"
,
"ENV"
,
"FCEDIT"
,
"fignore"
,
"fpath"
,
"histchars"
,
"HISTCHARS"
,
"HISTFILE"
,
"HISTSIZE"
,
"HOME"
,
"IFS"
,
"KEYBOARD_HACK"
,
"KEYTIMEOUT"
,
"LANG"
,
"LC_ALL"
,
"LC_COLLATE"
,
"LC_CTYPE"
,
"LC_MESSAGES"
,
"LC_NUMERIC"
,
"LC_TIME"
,
"LINES"
,
"LISTMAX"
,
"LOGCHECK"
,
"MAIL"
,
"MAILCHECK"
,
"mailpath"
,
"manpath"
,
"module_path"
,
"NULLCMD"
,
"path"
,
"POSTEDIT"
,
"PROMPT"
,
"PROMPT2"
,
"PROMPT3"
,
"PROMPT4"
,
"prompt"
,
"PROMPT_EOL_MARK"
,
"PS1"
,
"PS2"
,
"PS3"
,
"PS4"
,
"psvar"
,
"READNULLCMD"
,
"REPORTTIME"
,
"REPLY"
,
"reply"
,
"RPROMPT"
,
"RPS1"
,
"RPROMPT2"
,
"RPS2"
,
"SAVEHIST"
,
"SPROMPT"
,
"STTY"
,
"TERM"
,
"TERMINFO"
,
"TIMEFMT"
,
"TMOUT"
,
"TMPPREFIX"
,
"watch"
,
"WATCHFMT"
,
"WORDCHARS"
,
"ZBEEP"
,
"ZDOTDIR"
,
"ZLE_LINE_ABORTED"
,
"ZLE_REMOVE_SUFFIX_CHARS"
,
"ZLE_SPACE_SUFFIX_CHARS"
]
commonCommands
=
[
"admin"
,
"alias"
,
"ar"
,
"asa"
,
"at"
,
"awk"
,
"basename"
,
"batch"
,
"bc"
,
"bg"
,
"break"
,
"c99"
,
"cal"
,
"cat"
,
"cd"
,
"cflow"
,
"chgrp"
,
"chmod"
,
"chown"
,
"cksum"
,
"cmp"
,
"colon"
,
"comm"
,
"command"
,
"compress"
,
"continue"
,
"cp"
,
"crontab"
,
"csplit"
,
"ctags"
,
"cut"
,
"cxref"
,
"date"
,
"dd"
,
"delta"
,
"df"
,
"diff"
,
"dirname"
,
"dot"
,
"du"
,
"echo"
,
"ed"
,
"env"
,
"eval"
,
"ex"
,
"exec"
,
"exit"
,
"expand"
,
"export"
,
"expr"
,
"fc"
,
"fg"
,
"file"
,
"find"
,
"fold"
,
"fort77"
,
"fuser"
,
"gencat"
,
"get"
,
"getconf"
,
"getopts"
,
"grep"
,
"hash"
,
"head"
,
"iconv"
,
"ipcrm"
,
"ipcs"
,
"jobs"
,
"join"
,
"kill"
,
"lex"
,
"link"
,
"ln"
,
"locale"
,
"localedef"
,
"logger"
,
"logname"
,
"lp"
,
"ls"
,
"m4"
,
"mailx"
,
"make"
,
"man"
,
"mesg"
,
"mkdir"
,
"mkfifo"
,
"more"
,
"mv"
,
"newgrp"
,
"nice"
,
"nl"
,
"nm"
,
"nohup"
,
"od"
,
"paste"
,
"patch"
,
"pathchk"
,
"pax"
,
"pr"
,
"printf"
,
"prs"
,
"ps"
,
"pwd"
,
"qalter"
,
"qdel"
,
"qhold"
,
"qmove"
,
"qmsg"
,
"qrerun"
,
"qrls"
,
"qselect"
,
"qsig"
,
"qstat"
,
"qsub"
,
"read"
,
"readonly"
,
"renice"
,
"return"
,
"rm"
,
"rmdel"
,
"rmdir"
,
"sact"
,
"sccs"
,
"sed"
,
"set"
,
"sh"
,
"shift"
,
"sleep"
,
"sort"
,
"split"
,
"strings"
,
"strip"
,
"stty"
,
"tabs"
,
"tail"
,
"talk"
,
"tee"
,
"test"
,
"time"
,
"times"
,
"touch"
,
"tput"
,
"tr"
,
"trap"
,
"tsort"
,
"tty"
,
"type"
,
"ulimit"
,
"umask"
,
"unalias"
,
"uname"
,
"uncompress"
,
"unexpand"
,
"unget"
,
"uniq"
,
"unlink"
,
"unset"
,
"uucp"
,
"uudecode"
,
"uuencode"
,
"uustat"
,
"uux"
,
"val"
,
"vi"
,
"wait"
,
"wc"
,
"what"
,
"who"
,
"write"
,
"xargs"
,
"yacc"
,
"zcat"
]
ShellCheck/Parser.hs
浏览文件 @
7630136d
...
...
@@ -17,9 +17,10 @@
-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module
ShellCheck.Parser
(
Note
(
..
),
Severity
(
..
),
parseShell
,
ParseResult
(
..
),
ParseNote
(
..
),
notesFromMap
,
Metadata
(
..
),
sortNotes
,
commonCommands
)
where
module
ShellCheck.Parser
(
Note
(
..
),
Severity
(
..
),
parseShell
,
ParseResult
(
..
),
ParseNote
(
..
),
notesFromMap
,
Metadata
(
..
),
sortNotes
)
where
import
ShellCheck.AST
import
ShellCheck.Data
import
Text.Parsec
import
Debug.Trace
import
Control.Monad
...
...
@@ -1618,7 +1619,6 @@ g_Bang = do
softCondSpacing
return
$
T_Bang
id
commonCommands
=
[
"admin"
,
"alias"
,
"ar"
,
"asa"
,
"at"
,
"awk"
,
"basename"
,
"batch"
,
"bc"
,
"bg"
,
"break"
,
"c99"
,
"cal"
,
"cat"
,
"cd"
,
"cflow"
,
"chgrp"
,
"chmod"
,
"chown"
,
"cksum"
,
"cmp"
,
"colon"
,
"comm"
,
"command"
,
"compress"
,
"continue"
,
"cp"
,
"crontab"
,
"csplit"
,
"ctags"
,
"cut"
,
"cxref"
,
"date"
,
"dd"
,
"delta"
,
"df"
,
"diff"
,
"dirname"
,
"dot"
,
"du"
,
"echo"
,
"ed"
,
"env"
,
"eval"
,
"ex"
,
"exec"
,
"exit"
,
"expand"
,
"export"
,
"expr"
,
"fc"
,
"fg"
,
"file"
,
"find"
,
"fold"
,
"fort77"
,
"fuser"
,
"gencat"
,
"get"
,
"getconf"
,
"getopts"
,
"grep"
,
"hash"
,
"head"
,
"iconv"
,
"ipcrm"
,
"ipcs"
,
"jobs"
,
"join"
,
"kill"
,
"lex"
,
"link"
,
"ln"
,
"locale"
,
"localedef"
,
"logger"
,
"logname"
,
"lp"
,
"ls"
,
"m4"
,
"mailx"
,
"make"
,
"man"
,
"mesg"
,
"mkdir"
,
"mkfifo"
,
"more"
,
"mv"
,
"newgrp"
,
"nice"
,
"nl"
,
"nm"
,
"nohup"
,
"od"
,
"paste"
,
"patch"
,
"pathchk"
,
"pax"
,
"pr"
,
"printf"
,
"prs"
,
"ps"
,
"pwd"
,
"qalter"
,
"qdel"
,
"qhold"
,
"qmove"
,
"qmsg"
,
"qrerun"
,
"qrls"
,
"qselect"
,
"qsig"
,
"qstat"
,
"qsub"
,
"read"
,
"readonly"
,
"renice"
,
"return"
,
"rm"
,
"rmdel"
,
"rmdir"
,
"sact"
,
"sccs"
,
"sed"
,
"set"
,
"sh"
,
"shift"
,
"sleep"
,
"sort"
,
"split"
,
"strings"
,
"strip"
,
"stty"
,
"tabs"
,
"tail"
,
"talk"
,
"tee"
,
"test"
,
"time"
,
"times"
,
"touch"
,
"tput"
,
"tr"
,
"trap"
,
"tsort"
,
"tty"
,
"type"
,
"ulimit"
,
"umask"
,
"unalias"
,
"uname"
,
"uncompress"
,
"unexpand"
,
"unget"
,
"uniq"
,
"unlink"
,
"unset"
,
"uucp"
,
"uudecode"
,
"uuencode"
,
"uustat"
,
"uux"
,
"val"
,
"vi"
,
"wait"
,
"wc"
,
"what"
,
"who"
,
"write"
,
"xargs"
,
"yacc"
,
"zcat"
]
g_Semi
=
do
notFollowedBy2
g_DSEMI
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录