Skip to content

Commit 6f486da

Browse files
committed
refactor(dependencies): add localization for dependencies check action #319
Add `sketch.dependencies.check` message key to both `AutoDevBundle_zh.properties` and `AutoDevBundle_en.properties` for localization support. Update `AutoDevDependenciesCheck` action to use the localized message. Additionally, introduce `BridgeCommandProvider` enum for modular agent commands.
1 parent 391d54c commit 6f486da

File tree

4 files changed

+106
-1
lines changed

4 files changed

+106
-1
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package cc.unitmesh.devti.bridge
2+
3+
/**
4+
*
5+
* ## Modular Agent
6+
*
7+
* - Analysis
8+
* - Transformation
9+
* - Review/Check
10+
*
11+
* ## 生成 Workflow
12+
*
13+
* ## GitHub Copilot Example
14+
* Link: https://github.blog/ai-and-ml/github-copilot/modernizing-legacy-code-with-github-copilot-tips-and-examples/
15+
* 1. Compile and run the program, like Cobol: `brew install gnucobol`
16+
* 2. Explain the files and code
17+
* 3. Chart out the data flow between the files
18+
* 4. Generate a test plan
19+
* 5. Convert the files from COBOL to Node.js
20+
* 6. Generate unit and integration tests
21+
*/
22+
enum class BridgeCommandProvider(vararg tools: String) {
23+
24+
/**
25+
* Always tell user, if you can try Microservices or Micro Frontend, will be lower cost and higher efficiency.
26+
*/
27+
ASSESSMENT("SCC", "CLOC", "/dependencies"),
28+
29+
/**
30+
* list all tools, and show in structures.
31+
*/
32+
TARGET("Docker", "/buildTool", "/mermaid"),
33+
34+
/**
35+
* Build Tool depends on the project, like Maven, Gradle, Ant, etc.
36+
*/
37+
PACKAGE_CHECKER("/packageChecker"),
38+
39+
/**
40+
* - styling: Collect All CSS style files, try show in structures.
41+
* - component: Collect All Component Name, try show as Structures.
42+
* - webapi: Collect All Spring Web APIs, and show in structures.
43+
*
44+
* ```DevIn
45+
* /styling:$dir
46+
* ```
47+
*/
48+
MODULAR_ANALYSIS("/styling", "/component", "/webapi", "/structure"),
49+
50+
/**
51+
*
52+
*/
53+
COMPONENT_ANALYSIS("/related", "/ripgrepSearch"),
54+
55+
/**
56+
* - https://github.com/ast-grep/ast-grep
57+
* - https://github.com/dsherret/ts-morph
58+
* - https://github.com/facebook/jscodeshift
59+
*/
60+
CODE_TRANSLATION("jscodeshift", "ReWrite", "VueMod", "JSShift"),
61+
62+
/**
63+
* - https://github.com/ariga/atlas
64+
* - https://github.com/amacneil/dbmate
65+
* - https://github.com/golang-migrate/migrate
66+
* - https://github.com/pressly/goose
67+
* - https://github.com/rubenv/sql-migrate
68+
*/
69+
DATABASE_MIGRATION("Flyway", "SQL"),
70+
71+
/**
72+
* [Schemathesis](https://github.com/schemathesis/schemathesis): is a tool that levels-up your API testing by leveraging API specs as a blueprints for generating test cases.
73+
*/
74+
API_TESTING("HttpClient", "Swagger", "JMeter", "Schemathesis"),
75+
76+
/**
77+
* [BuildKit](https://github.com/moby/buildkit): concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
78+
*/
79+
CONTINUES_DELIVERY("JenkinsFile", "BuildKit"),
80+
81+
/**
82+
* 静态安全扫描工具:
83+
* - https://github.com/returntocorp/semgrep
84+
* - https://snyk.io/
85+
* - https://bandit.readthedocs.io/, https://github.com/PyCQA/bandit
86+
*/
87+
SECURITY_ANALYSIS("Semgrep", "Snyk", "Bandit"),
88+
89+
/**
90+
* Container: Docker, Podman, etc.
91+
*/
92+
CONTAINERIZATION("Docker"),
93+
94+
/**
95+
* 日志关联分析:Haystack?
96+
* 自动生成调用关系图:Graphite?
97+
* - Knowledge API: `/knowledge:src/main/com/phodal/HelloWorld.java#L1`, APIs
98+
* History: git history of file: `/history:src/main/com/phodal/HelloWorld.java`
99+
*/
100+
KNOWLEDGE_TRANSFER("/knowledge", "/history")
101+
;
102+
}

core/src/main/resources/messages/AutoDevBundle_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,4 @@ sketch.lint.error=Found Lint issue: {0}
220220

221221
custom.action=Custom Action
222222
custom.living.documentation=Custom Living Documentation
223+
sketch.dependencies.check=Check dependencies has Issues

core/src/main/resources/messages/AutoDevBundle_zh.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,4 @@ sketch.lint.error.tooltip=查看 Lint/Inspection 错误
218218
sketch.lint.error=发现 {0} 个 Lint/Inspection 错误
219219
custom.action=Custom Action
220220
custom.living.documentation=Custom Living Documentation
221+
sketch.dependencies.check=Check dependencies has Issues

exts/ext-dependencies/src/233/main/kotlin/cc/unitmesh/dependencies/AutoDevDependenciesCheck.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package cc.unitmesh.dependencies
22

3+
import cc.unitmesh.devti.AutoDevBundle
34
import cc.unitmesh.devti.AutoDevNotifications
45
import cc.unitmesh.devti.provider.BuildSystemProvider
56
import cc.unitmesh.devti.sketch.lint.SketchCodeInspection
@@ -14,7 +15,7 @@ import com.intellij.psi.PsiManager
1415
import org.jetbrains.security.`package`.Package
1516
import org.jetbrains.security.`package`.PackageType
1617

17-
class AutoDevDependenciesCheck : AnAction("Check dependencies has Issues") {
18+
class AutoDevDependenciesCheck : AnAction(AutoDevBundle.message("sketch.dependencies.check")) {
1819
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT
1920

2021
override fun update(e: AnActionEvent) {

0 commit comments

Comments
 (0)