Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
03a4e53a
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
03a4e53a
编写于
8月 01, 2018
作者:
M
Michael Goderbauer
提交者:
GitHub
8月 01, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update license script & analyze it on CI (#5917)
上级
9f9a564e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
21 deletion
+36
-21
tools/licenses/analysis_options.yaml
tools/licenses/analysis_options.yaml
+4
-4
tools/licenses/lib/filesystem.dart
tools/licenses/lib/filesystem.dart
+4
-4
tools/licenses/lib/licenses.dart
tools/licenses/lib/licenses.dart
+4
-4
tools/licenses/lib/main.dart
tools/licenses/lib/main.dart
+9
-9
travis/analyze.sh
travis/analyze.sh
+15
-0
未找到文件。
tools/licenses/
.analysis_options
→
tools/licenses/
analysis_options.yaml
浏览文件 @
03a4e53a
...
...
@@ -2,9 +2,9 @@
analyzer
:
language
:
enableStrictCallChecks: true
enableSuperMixins
:
true
strong-mode: true
strong-mode
:
implicit-dynamic
:
false
errors
:
strong_mode_invalid_field_override
:
ignore
strong_mode_down_cast_composite
:
ignore
...
...
@@ -19,7 +19,7 @@ linter:
-
control_flow_in_finally
-
empty_statements
-
hash_and_equals
- invariant_booleans
# - invariant_booleans # Produces false positives, see https://github.com/flutter/flutter/issues/5790
-
iterable_contains_unrelated_type
-
list_remove_unrelated_type
-
literal_only_boolean_expressions
...
...
@@ -53,6 +53,6 @@ linter:
-
type_annotate_public_apis
-
type_init_formals
-
unawaited_futures
- unnecessary_brace_in_string_interp
-
unnecessary_brace_in_string_interp
s
-
unnecessary_getters_setters
-
package_names
tools/licenses/lib/filesystem.dart
浏览文件 @
03a4e53a
...
...
@@ -59,7 +59,7 @@ const String kMultiLicenseFileHeader = 'Notices for files contained in';
bool
isMultiLicenseNotice
(
Reader
reader
)
{
List
<
int
>
bytes
=
reader
();
return
(
ASCII
.
decode
(
bytes
.
take
(
kMultiLicenseFileHeader
.
length
).
toList
(),
allowInvalid:
true
)
==
kMultiLicenseFileHeader
);
return
(
ascii
.
decode
(
bytes
.
take
(
kMultiLicenseFileHeader
.
length
).
toList
(),
allowInvalid:
true
)
==
kMultiLicenseFileHeader
);
}
FileType
identifyFile
(
String
name
,
Reader
reader
)
{
...
...
@@ -314,7 +314,7 @@ abstract class UTF8TextFile extends TextFile {
@override
String
readString
()
{
try
{
return
cache
(
new
UTF8Of
(
this
),
()
=>
UTF
8
.
decode
(
readBytes
()));
return
cache
(
new
UTF8Of
(
this
),
()
=>
utf
8
.
decode
(
readBytes
()));
}
on
FormatException
{
print
(
fullName
);
rethrow
;
...
...
@@ -332,13 +332,13 @@ abstract class Latin1TextFile extends TextFile {
throw
'
$fullName
contains a U+0000 NULL and is probably not actually encoded as Win1252'
;
bool
isUTF8
=
false
;
try
{
cache
(
new
UTF8Of
(
this
),
()
=>
UTF
8
.
decode
(
readBytes
()));
cache
(
new
UTF8Of
(
this
),
()
=>
utf
8
.
decode
(
readBytes
()));
isUTF8
=
true
;
}
on
FormatException
{
}
if
(
isUTF8
)
throw
'
$fullName
contains valid UTF-8 and is probably not actually encoded as Win1252'
;
return
LATIN
1
.
decode
(
bytes
);
return
latin
1
.
decode
(
bytes
);
});
}
}
...
...
tools/licenses/lib/licenses.dart
浏览文件 @
03a4e53a
...
...
@@ -325,19 +325,19 @@ abstract class License implements Comparable<License> {
bool
isUTF8
=
true
;
List
<
int
>
latin1Encoded
;
try
{
latin1Encoded
=
LATIN
1
.
encode
(
body
);
latin1Encoded
=
latin
1
.
encode
(
body
);
isUTF8
=
false
;
}
on
ArgumentError
{
}
if
(!
isUTF8
)
{
bool
isAscii
=
false
;
try
{
ASCII
.
decode
(
latin1Encoded
);
ascii
.
decode
(
latin1Encoded
);
isAscii
=
true
;
}
on
FormatException
{
}
if
(
isAscii
)
return
;
try
{
UTF
8
.
decode
(
latin1Encoded
);
utf
8
.
decode
(
latin1Encoded
);
isUTF8
=
true
;
}
on
FormatException
{
}
if
(
isUTF8
)
...
...
@@ -530,7 +530,7 @@ _SplitLicense _splitLicense(String body, { bool verifyResults: true }) {
if
(!
lines
.
moveNext
())
throw
'tried to split empty license'
;
int
end
=
0
;
while
(
true
)
{
while
(
true
)
{
// ignore: literal_only_boolean_expressions
final
String
line
=
lines
.
current
.
value
;
if
(
line
==
'Author:'
||
line
==
'This code is derived from software contributed to Berkeley by'
||
...
...
tools/licenses/lib/main.dart
浏览文件 @
03a4e53a
...
...
@@ -736,33 +736,33 @@ class RepositoryMultiLicenseNoticesForFilesFile extends RepositoryLicenseFile {
// "Notices for files contained in the"
// ...then have a second line which is 60 "=" characters
final
List
<
List
<
int
>>
contents
=
splitIntList
(
io
.
readBytes
(),
0x0A
).
toList
();
if
(!
ASCII
.
decode
(
contents
[
0
]).
startsWith
(
'Notices for files contained in'
)
||
ASCII
.
decode
(
contents
[
1
])
!=
'============================================================
\n
'
)
if
(!
ascii
.
decode
(
contents
[
0
]).
startsWith
(
'Notices for files contained in'
)
||
ascii
.
decode
(
contents
[
1
])
!=
'============================================================
\n
'
)
throw
'unrecognised syntax:
${io.fullName}
'
;
int
index
=
2
;
while
(
index
<
contents
.
length
)
{
if
(
ASCII
.
decode
(
contents
[
index
])
!=
'Notices for file(s):
\n
'
)
if
(
ascii
.
decode
(
contents
[
index
])
!=
'Notices for file(s):
\n
'
)
throw
'unrecognised syntax on line
${index + 1}
:
${io.fullName}
'
;
index
+=
1
;
final
List
<
String
>
names
=
<
String
>[];
do
{
names
.
add
(
ASCII
.
decode
(
contents
[
index
]));
names
.
add
(
ascii
.
decode
(
contents
[
index
]));
index
+=
1
;
}
while
(
ASCII
.
decode
(
contents
[
index
])
!=
'------------------------------------------------------------
\n
'
);
}
while
(
ascii
.
decode
(
contents
[
index
])
!=
'------------------------------------------------------------
\n
'
);
index
+=
1
;
final
List
<
List
<
int
>>
body
=
<
List
<
int
>>[];
do
{
body
.
add
(
contents
[
index
]);
index
+=
1
;
}
while
(
index
<
contents
.
length
&&
ASCII
.
decode
(
contents
[
index
],
allowInvalid:
true
)
!=
'============================================================
\n
'
);
ascii
.
decode
(
contents
[
index
],
allowInvalid:
true
)
!=
'============================================================
\n
'
);
index
+=
1
;
final
List
<
int
>
bodyBytes
=
body
.
expand
((
List
<
int
>
line
)
=>
line
).
toList
();
String
bodyText
;
try
{
bodyText
=
UTF
8
.
decode
(
bodyBytes
);
bodyText
=
utf
8
.
decode
(
bodyBytes
);
}
on
FormatException
{
bodyText
=
LATIN
1
.
decode
(
bodyBytes
);
bodyText
=
latin
1
.
decode
(
bodyBytes
);
}
License
license
=
new
License
.
unique
(
bodyText
,
LicenseType
.
unknown
,
origin:
io
.
fullName
);
for
(
String
name
in
names
)
{
...
...
@@ -2545,7 +2545,7 @@ Future<Null> main(List<String> arguments) async {
system
.
File
goldenFile
=
new
system
.
File
(
path
.
join
(
argResults
[
'golden'
],
'licenses_
${component.io.name}
'
));
String
goldenSignature
=
await
goldenFile
.
openRead
()
.
transform
(
UTF
8
.
decoder
).
transform
(
new
LineSplitter
()).
first
;
.
transform
(
utf
8
.
decoder
).
transform
(
new
LineSplitter
()).
first
;
Match
goldenMatch
=
signaturePattern
.
matchAsPrefix
(
goldenSignature
);
if
(
goldenMatch
!=
null
&&
goldenMatch
.
group
(
1
)
==
signature
)
{
system
.
stderr
.
writeln
(
' Skipping this component - no change in signature'
);
...
...
travis/analyze.sh
浏览文件 @
03a4e53a
...
...
@@ -46,3 +46,18 @@ if [ -n "$RESULTS" ]; then
echo
"Failed."
exit
1
;
fi
echo
"Analyzing tools/licenses..."
(
cd
flutter/tools/licenses
&&
pub get
)
RESULTS
=
`
dartanalyzer
\
--packages
=
flutter/tools/licenses/.packages
\
--options
flutter/tools/licenses/analysis_options.yaml
\
flutter/tools/licenses
\
2>&1
\
|
grep
-Ev
"No issues found!"
\
|
grep
-Ev
"Analyzing.+tools/licenses"
`
echo
"
$RESULTS
"
if
[
-n
"
$RESULTS
"
]
;
then
echo
"Failed."
exit
1
;
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录