Skip to content

[feature] 新增基于规则的 provider#231

Merged
Triple-Z merged 1 commit into
deb-sig:masterfrom
fatsheep2:codex/runtime-template-provider-core
Jun 3, 2026
Merged

[feature] 新增基于规则的 provider#231
Triple-Z merged 1 commit into
deb-sig:masterfrom
fatsheep2:codex/runtime-template-provider-core

Conversation

@fatsheep2

Copy link
Copy Markdown
Contributor

Description

新增运行时模板 Provider 的核心解释器能力,用规则表达导入逻辑,并补充模板 Provider 的使用文档与示例配置。

本 PR 未关联具体 issue。

Motivation and Context

当前各 Provider 的导入逻辑分散在专用代码里,维护和扩展新账单格式成本较高。

本 PR 将可复用的解析、规则匹配、变量、posting 生成等能力收敛到运行时模板 Provider 中。后续模板可以在独立模板仓库维护,DEG 主库只保留解释器、CLI 和文档入口,减少主库与模板数据的耦合。

Dependencies

无新增运行时外部依赖。

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

已在本地运行以下测试:

  • Test A: GOCACHE=/private/tmp/go-build-cache GOPATH=/private/tmp/go-path make check-format
  • Test B: GOCACHE=/private/tmp/go-build-cache GOPATH=/private/tmp/go-path go test ./pkg/cmd ./pkg/importer ./pkg/compiler/...
  • Test C: GOCACHE=/private/tmp/go-build-cache GOPATH=/private/tmp/go-path make test
  • Test D: GOCACHE=/private/tmp/go-build-cache GOPATH=/private/tmp/go-path GOLANGCI_LINT_CACHE=/private/tmp/golangci-lint-cache PATH=/private/tmp/go-path/bin:$PATH golangci-lint run --timeout=5m

测试配置:macOS,本地 Go cache/GOPATH 指向 /private/tmp

Is this change properly documented?

是。已补充模板 Provider 文档、配置说明和示例。

@fatsheep2 fatsheep2 requested review from a team, Triple-Z and gaocegege as code owners May 30, 2026 06:53
@fatsheep2

Copy link
Copy Markdown
Contributor Author

@gaocegege @Triple-Z @deb-sig/generator-dev need review
这次把jieba的拆成另一个pr了,仅包含必要更改

@Triple-Z Triple-Z left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Triple-Z Triple-Z merged commit 639ea22 into deb-sig:master Jun 3, 2026
4 checks passed
@Triple-Z

Triple-Z commented Jun 3, 2026

Copy link
Copy Markdown
Member

This feature can be considered as v3 core feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants