Skip to content

Commit 3f0537a

Browse files
authored
Simplify the code generation CLI parameters (#837)
1 parent d1cdb9e commit 3f0537a

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v6.0.0
44
hooks:
5-
# - id: check-added-large-files
6-
# - id: end-of-file-fixer
5+
- id: end-of-file-fixer
76
- id: check-yaml
87
- id: check-toml
98

109
- repo: https://github.com/charliermarsh/ruff-pre-commit
11-
rev: v0.12.11
10+
rev: v0.13.2
1211
hooks:
1312
- id: ruff
1413
args:
@@ -20,7 +19,7 @@ repos:
2019
- id: ruff-format
2120

2221
- repo: https://github.com/astral-sh/uv-pre-commit
23-
rev: 0.8.14
22+
rev: 0.8.22
2423
hooks:
2524
- id: uv-lock
2625
- id: uv-export

backend/cli.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ async def import_table(
148148
raise cappa.Exit(e.msg if isinstance(e, BaseExceptionMixin) else str(e), code=1)
149149

150150

151-
def generate(gen: bool) -> None:
152-
if not gen:
153-
console.print(output_help)
154-
return
155-
151+
def generate() -> None:
156152
try:
157153
ids = []
158154
results = run_await(gen_business_service.get_all)()
@@ -311,14 +307,10 @@ async def __call__(self):
311307
@cappa.command(name='codegen', help='代码生成(体验完整功能,请自行部署 fba vben 前端工程)', default_long=True)
312308
@dataclass
313309
class CodeGenerate:
314-
gen: Annotated[
315-
bool,
316-
cappa.Arg(default=False, show_default=False, help='执行代码生成'),
317-
]
318310
subcmd: cappa.Subcommands[Import | None] = None
319311

320312
def __call__(self):
321-
generate(self.gen)
313+
generate()
322314

323315

324316
@cappa.command(help='一个高效的 fba 命令行界面', default_long=True)

backend/plugin/dict/sql/mysql/init.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ values
5050
(33, 'user_online_status', '离线', '0', 'warning', 1, 1, '用户离线状态', 11, now(), null),
5151
(34, 'user_online_status', '在线', '1', 'success', 2, 1, '用户在线状态', 11, now(), null),
5252
(35, 'sys_plugin_type', '压缩包', '0', 'gold', 1, 1, '插件类型-压缩包', 12, now(), null),
53-
(36, 'sys_plugin_type', 'GIT', '1', 'processing', 2, 1, '插件类型-GIT', 12, now(), null);
53+
(36, 'sys_plugin_type', 'GIT', '1', 'processing', 2, 1, '插件类型-GIT', 12, now(), null);

0 commit comments

Comments
 (0)