Skip to content

Commit 1f0081c

Browse files
committed
2 parents 686adda + 488785b commit 1f0081c

29 files changed

Lines changed: 1000 additions & 886 deletions

File tree

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
- name: Checkout Repo
2525
uses: actions/checkout@v3
2626

27-
- name: Setup Node 14
27+
- name: Setup Node 16
2828
uses: actions/setup-node@v3
2929
with:
3030
# 选择要使用的 node 版本
31-
node-version: "14"
31+
node-version: "16"
3232
cache: "yarn"
3333
cache-dependency-path: "doc/yarn.lock"
3434

@@ -39,8 +39,8 @@ jobs:
3939
with:
4040
path: doc/node_modules
4141
key: ${{ runner.os }}-yarn-${{ hashFiles('doc/yarn.lock') }}
42-
restore-keys: |
43-
${{ runner.os }}-yarn-
42+
# restore-keys: |
43+
# ${{ runner.os }}-yarn-
4444

4545
# 如果缓存没有命中,安装依赖
4646
- if: ${{ steps.yarn-cache.outputs.cache-hit == false }}

client/node/servertask/looprunner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ def run(self):
193193
kill_task_id = task_params['task_id']
194194
# kill task时进程如果已不存在,会报异常: ProcessLookupError: [Errno 3] No such process
195195
self._terminate_task(kill_task_id)
196+
# 等待一段时间后再接下一个任务
197+
time.sleep(self._get_task_interval)
196198
continue
197199

198200
# 获取到分析任务,向server发送确认信息(kill_task不需要确认)
@@ -229,6 +231,8 @@ def run(self):
229231
task = Task(task_id, task_name, request_file, response_file, task_log, env=self._origin_os_env)
230232
task.start()
231233
self._running_task.append(task)
234+
# 等待一段时间后再接下一个任务
235+
time.sleep(self._get_task_interval)
232236
except:
233237
# 遇到异常,输出异常信息
234238
LogPrinter.exception("task loop encounter error.")

client/node/toolloader/httploadtool.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from util.logutil import LogPrinter
1515
from util.api.fileserver import RetryFileServer
1616
from util.exceptions import FileServerError
17-
from util.ziplib import ZipMgr
17+
from util.pathlib import PathMgr
18+
from util.zipmgr import Zip
1819

1920

2021
class HttpToolLoader(object):
@@ -37,8 +38,10 @@ def download_tool(tool_url, dest_dir):
3738

3839
if os.path.exists(dest_zip_file_path):
3940
LogPrinter.debug(f"download {tool_url} to {dest_zip_file_path}")
40-
ZipMgr.depress(dest_zip_file_path, tool_root_dir)
41+
# 使用7z解压
42+
Zip().decompress_by_7z(dest_zip_file_path, tool_root_dir)
4143
LogPrinter.debug(f"unzip {dest_zip_file_path} to {dest_dir}")
44+
PathMgr().safe_rmpath(dest_zip_file_path)
4245
else:
4346
raise FileServerError(f"download {tool_url} failed!")
4447

client/settings/edition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ class Edition(Enum):
2828
# 版本号
2929
# ========================
3030
# puppy版本号,格式:浮点数,整数部分为8位日期,小数部分为编号(从1开始)
31-
VERSION = 20220718.1
31+
VERSION = 20220907.1

doc/.vuepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineUserConfig } from '@vuepress/cli'
22
import { defaultTheme } from '@vuepress/theme-default'
3+
import { searchPlugin } from '@vuepress/plugin-search'
34
import { navbar, sidebar } from './configs'
4-
const { searchPlugin } = require('@vuepress/plugin-search')
55

66
const isProd = process.env.NODE_ENV === 'production'
77

doc/.vuepress/configs/sidebar/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const en: SidebarConfig = {
2727
children: [
2828
'/en/guide/代码检查/工具/eslint.md',
2929
'/en/guide/代码检查/工具/golangcilint.md',
30+
'/eh/guide/代码检查/工具/regexscanner.md',
3031
],
3132
},
3233
]

doc/.vuepress/configs/sidebar/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const zh: SidebarConfig = {
2727
children: [
2828
'/zh/guide/代码检查/工具/eslint.md',
2929
'/zh/guide/代码检查/工具/golangcilint.md',
30+
'/zh/guide/代码检查/工具/regexscanner.md',
3031
],
3132
},
3233
]

doc/en/guide/代码检查/工具/regexscanner.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ TCA独立工具TCA-Armory-R,别名RegexScanner,正则匹配工具,支持
6969

7070
- (5) [可选] `file_scan` 参数,用于指定是否扫描文件名称,可选值:True、true、False、false 。例如: `file_scan=True`, 默认是False
7171

72-
- (6) [可选] `include` 参数,用于指定扫描文件匹配范围,基于相对路径,使用正则匹配格式,多项使用英文分号(;)隔开。例如: `include=path/to/dir;path/to/.*\\.cpp`
72+
- (6) [可选] `include` 参数,用于指定只扫描的文件匹配范围,基于相对路径,使用通配符格式,多项使用英文分号(;)隔开。例如: `include=src/test;src/main.*;*.cpp`
7373

74-
- (7) [可选] `exclude` 参数,用于指定不扫描的文件匹配范围。格式参考include参数。
74+
- (7) [可选] `exclude` 参数,用于指定不扫描的文件匹配范围,格式同include参数,例如: `exclude=tests;*.json`
75+
76+
> 路径过滤(`exclude`, `include`)采用Glob-Style的匹配模式,详见 [Go-filepath-Match](https://pkg.go.dev/path/filepath#Match), 除了 `**` 用来匹配零或多个目录,本工具会**默认匹配前后目录**。举例:
77+
> > 1. `exclude=*.py` 会忽略以下文件: main.py, src/main.py, main.py/install.sh
78+
> > 2. `exclude=tests` 会忽略以下文件: tests/test.py, a/tests/b/test.py
79+
> > 3. `include=main.*` 会只扫描以下文件: src/main.py, app/main.go
80+
> > 4. `include=src``exclude=src/lib` 会只扫描以下文件: src/main.py, src/project/proj.py; 忽略以下文件: src/lib/lib.py, src/lib/package/pack.js
7581
7682
### 4. 将自定义规则添加到项目分析方案中
7783
进入 代码分析 - 分析方案 - 代码检查 - 自定义规则包 - 查看详细规则,添加规则。

doc/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
"tca",
77
"document"
88
],
9+
"type": "module",
910
"license": "MIT",
1011
"scripts": {
1112
"dev": "vuepress dev",
1213
"build:comment": "echo '构建帮助文档,默认base前缀为document,可根据部署需要进行相应调整'",
1314
"build": "BASE=${BASE:-CodeAnalysis} vuepress build -d ./dist"
1415
},
1516
"devDependencies": {
16-
"@vuepress/plugin-search": "^2.0.0-beta.43",
17-
"vuepress": "^2.0.0-beta.42"
17+
"@vuepress/plugin-search": "2.0.0-beta.51",
18+
"vuepress": "2.0.0-beta.51"
1819
}
19-
}
20+
}

0 commit comments

Comments
 (0)