Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
koalaman
ShellCheck
提交
4ce916ec
S
ShellCheck
项目概览
镜像
/
koalaman
/
ShellCheck
上一次同步 11 个月
通知
42
Star
0
Fork
1
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
4ce916ec
编写于
10月 14, 2015
作者:
V
Vidar Holen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Include bash builtin arrays in SC2128.
上级
b9cb0401
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
4 deletion
+12
-4
ShellCheck/Analytics.hs
ShellCheck/Analytics.hs
+6
-4
ShellCheck/Data.hs
ShellCheck/Data.hs
+6
-0
未找到文件。
ShellCheck/Analytics.hs
浏览文件 @
4ce916ec
...
...
@@ -991,24 +991,26 @@ prop_checkArrayWithoutIndex2 = verifyNotTree checkArrayWithoutIndex "foo='bar ba
prop_checkArrayWithoutIndex3
=
verifyTree
checkArrayWithoutIndex
"coproc foo while true; do echo cow; done; echo $foo"
prop_checkArrayWithoutIndex4
=
verifyTree
checkArrayWithoutIndex
"coproc tail -f log; echo $COPROC"
prop_checkArrayWithoutIndex5
=
verifyTree
checkArrayWithoutIndex
"a[0]=foo; echo $a"
prop_checkArrayWithoutIndex6
=
verifyTree
checkArrayWithoutIndex
"echo $PIPESTATUS"
checkArrayWithoutIndex
params
_
=
concat
$
doVariableFlowAnalysis
readF
writeF
Map
.
empty
(
variableFlow
params
)
concat
$
doVariableFlowAnalysis
readF
writeF
defaultMap
(
variableFlow
params
)
where
defaultMap
=
Map
.
fromList
$
map
(
\
x
->
(
x
,
()
))
arrayVariables
readF
_
(
T_DollarBraced
id
token
)
_
=
do
map
<-
get
return
.
maybeToList
$
do
name
<-
getLiteralString
token
assign
ment
<-
Map
.
lookup
name
map
assign
ed
<-
Map
.
lookup
name
map
return
[
makeComment
WarningC
id
2128
"Expanding an array without an index only gives the first element."
]
readF
_
_
_
=
return
[]
writeF
_
t
name
(
DataArray
_
)
=
do
modify
(
Map
.
insert
name
t
)
modify
(
Map
.
insert
name
()
)
return
[]
writeF
_
expr
name
_
=
do
if
isIndexed
expr
then
modify
(
Map
.
insert
name
expr
)
then
modify
(
Map
.
insert
name
()
)
else
modify
(
Map
.
delete
name
)
return
[]
...
...
ShellCheck/Data.hs
浏览文件 @
4ce916ec
...
...
@@ -41,6 +41,12 @@ variablesWithoutSpaces = [
"COLUMNS"
,
"HISTFILESIZE"
,
"HISTSIZE"
,
"LINES"
]
arrayVariables
=
[
"BASH_ALIASES"
,
"BASH_ARGC"
,
"BASH_ARGV"
,
"BASH_CMDS"
,
"BASH_LINENO"
,
"BASH_REMATCH"
,
"BASH_SOURCE"
,
"BASH_VERSINFO"
,
"COMP_WORDS"
,
"COPROC"
,
"DIRSTACK"
,
"FUNCNAME"
,
"GROUPS"
,
"MAPFILE"
,
"PIPESTATUS"
,
"COMPREPLY"
]
commonCommands
=
[
"admin"
,
"alias"
,
"ar"
,
"asa"
,
"at"
,
"awk"
,
"basename"
,
"batch"
,
"bc"
,
"bg"
,
"break"
,
"c99"
,
"cal"
,
"cat"
,
"cd"
,
"cflow"
,
"chgrp"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录