Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
8ebdf5db
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8ebdf5db
编写于
7月 19, 2022
作者:
B
Boris Sekachev
提交者:
GitHub
7月 19, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed eslint config (#131)
* Fixed eslint config * Updated yarn.lock
上级
b5b828e5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
43 addition
and
13 deletion
+43
-13
lint-staged.config.js
lint-staged.config.js
+2
-0
package.json
package.json
+1
-0
tests/.eslintrc.js
tests/.eslintrc.js
+20
-3
tests/cypress/integration/actions_objects/case_20_objects_ordering_feature.js
...ation/actions_objects/case_20_objects_ordering_feature.js
+11
-9
tests/package.json
tests/package.json
+1
-0
tests/yarn.lock
tests/yarn.lock
+8
-1
未找到文件。
lint-staged.config.js
浏览文件 @
8ebdf5db
...
...
@@ -14,6 +14,7 @@ module.exports = (stagedFiles) => {
const
eslintExtensions
=
[
'
ts
'
,
'
tsx
'
,
'
js
'
].
map
(
makePattern
);
const
eslintFiles
=
micromatch
(
stagedFiles
,
eslintExtensions
);
const
tests
=
containsInPath
(
'
/tests/
'
,
eslintFiles
);
const
cvatData
=
containsInPath
(
'
/cvat-data/
'
,
eslintFiles
);
const
cvatCore
=
containsInPath
(
'
/cvat-core/
'
,
eslintFiles
);
const
cvatCanvas
=
containsInPath
(
'
/cvat-canvas/
'
,
eslintFiles
);
...
...
@@ -22,6 +23,7 @@ module.exports = (stagedFiles) => {
const
mapping
=
{};
const
commands
=
[];
mapping
[
'
yarn run precommit:cvat-tests --
'
]
=
tests
.
join
(
'
'
);
mapping
[
'
yarn run precommit:cvat-ui --
'
]
=
cvatUI
.
join
(
'
'
);
mapping
[
'
yarn run precommit:cvat-data --
'
]
=
cvatData
.
join
(
'
'
);
mapping
[
'
yarn run precommit:cvat-core --
'
]
=
cvatCore
.
join
(
'
'
);
...
...
package.json
浏览文件 @
8ebdf5db
...
...
@@ -95,6 +95,7 @@
"cp"
:
"cp -r cvat-ui_cov/* cvat-ui && cp -r cvat-canvas_cov/* cvat-canvas && cp -r cvat-data_cov/* cvat-data && cp -r cvat-core_cov/* cvat-core"
,
"rm"
:
"rm -rf cvat-ui_cov cvat-canvas_cov cvat-data_cov cvat-core_cov"
,
"prepare"
:
"husky install && rm .husky/pre-commit; npx husky add .husky/pre-commit
\"
npx lint-staged
\"
"
,
"precommit:cvat-tests"
:
"cd tests && eslint --fix"
,
"precommit:cvat-data"
:
"cd cvat-data && eslint --fix"
,
"precommit:cvat-core"
:
"cd cvat-core && eslint --fix"
,
"precommit:cvat-canvas"
:
"cd cvat-canvas && eslint --fix"
,
...
...
tests/.eslintrc.js
浏览文件 @
8ebdf5db
...
...
@@ -2,9 +2,26 @@
//
// SPDX-License-Identifier: MIT
const
globalConfig
=
require
(
'
../.eslintrc.js
'
);
module
.
exports
=
{
env
:
{
'
cypress/globals
'
:
true
,
root
:
true
,
parserOptions
:
{
parser
:
'
babel-eslint
'
,
sourceType
:
'
module
'
,
},
ignorePatterns
:
[
'
.eslintrc.js
'
,
'
lint-staged.config.js
'
,
],
plugins
:
[
'
security
'
,
'
no-unsanitized
'
,
'
eslint-plugin-header
'
,
'
import
'
],
extends
:
[
'
eslint:recommended
'
,
'
plugin:security/recommended
'
,
'
plugin:no-unsanitized/DOM
'
,
'
plugin:cypress/recommended
'
,
'
airbnb-base
'
,
'
plugin:import/errors
'
,
'
plugin:import/warnings
'
,
],
rules
:
{
...
Object
.
fromEntries
(
Object
.
entries
(
globalConfig
.
rules
).
filter
(([
key
])
=>
{
return
!
key
.
startsWith
(
'
@typescript-eslint
'
)
})),
},
plugins
:
[
'
cypress
'
]
};
tests/cypress/integration/actions_objects/case_20_objects_ordering_feature.js
浏览文件 @
8ebdf5db
...
...
@@ -12,7 +12,7 @@ context('Objects ordering feature', () => {
const
createRectangleShape2Points
=
{
points
:
'
By 2 Points
'
,
type
:
'
Shape
'
,
labelName
:
labelName
,
labelName
,
firstX
:
250
,
firstY
:
350
,
secondX
:
350
,
...
...
@@ -22,7 +22,7 @@ context('Objects ordering feature', () => {
const
createRectangleShape2PointsSecond
=
{
points
:
'
By 2 Points
'
,
type
:
'
Shape
'
,
labelName
:
labelName
,
labelName
,
firstX
:
createRectangleShape2Points
.
firstX
+
300
,
firstY
:
createRectangleShape2Points
.
firstY
,
secondX
:
createRectangleShape2Points
.
secondX
+
300
,
...
...
@@ -30,18 +30,20 @@ context('Objects ordering feature', () => {
};
function
checkSideBarItemOrdering
(
ordering
)
{
let
cvatObjectsSidebarStateItemIdList
=
[];
const
cvatObjectsSidebarStateItemIdList1
=
[];
cy
.
get
(
'
.cvat-objects-sidebar-state-item
'
).
then
((
$cvatObjectsSidebarStateItemId
)
=>
{
for
(
let
i
=
0
;
i
<
$cvatObjectsSidebarStateItemId
.
length
;
i
++
)
{
cvatObjectsSidebarStateItemIdList
.
push
(
Number
(
$cvatObjectsSidebarStateItemId
[
i
].
id
.
match
(
/
\d
+$/
)));
cvatObjectsSidebarStateItemIdList
1
.
push
(
Number
(
$cvatObjectsSidebarStateItemId
[
i
].
id
.
match
(
/
\d
+$/
)));
}
const
idAscent
=
cvatObjectsSidebarStateItemIdList
.
reduce
((
previousValue
,
currentValue
)
=>
{
return
previousValue
>
currentValue
?
false
:
true
;
}
);
const
idAscent
=
cvatObjectsSidebarStateItemIdList
1
.
reduce
((
previousValue
,
currentValue
)
=>
(
!
(
previousValue
>
currentValue
)
)
);
if
(
ordering
===
'
ascent
'
)
{
expect
(
idAscent
).
to
.
be
.
true
;
//expected true to be true (ascent)
/* eslint-disable-next-line */
expect
(
idAscent
).
to
.
be
.
true
;
// expected true to be true (ascent)
}
else
{
expect
(
idAscent
).
to
.
be
.
false
;
//expected false to be false (descent)
/* eslint-disable-next-line */
expect
(
idAscent
).
to
.
be
.
false
;
// expected false to be false (descent)
}
});
}
...
...
tests/package.json
浏览文件 @
8ebdf5db
...
...
@@ -12,6 +12,7 @@
"cypress-file-upload"
:
"^5.0.8"
,
"cypress-localstorage-commands"
:
"^1.7.0"
,
"cypress-real-events"
:
"^1.6.0"
,
"eslint-plugin-cypress"
:
"^2.12.1"
,
"extract-zip"
:
"^2.0.1"
,
"fs-extra"
:
"^10.1.0"
,
"jimp"
:
"^0.16.1"
...
...
tests/yarn.lock
浏览文件 @
8ebdf5db
...
...
@@ -1265,6 +1265,13 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
eslint-plugin-cypress@^2.12.1:
version "2.12.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz#9aeee700708ca8c058e00cdafe215199918c2632"
integrity sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA==
dependencies:
globals "^11.12.0"
esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
...
...
@@ -1523,7 +1530,7 @@ global@~4.4.0:
min-document "^2.19.0"
process "^0.11.10"
globals@^11.1.0:
globals@^11.1.0
, globals@^11.12.0
:
version "11.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录