-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #1491 add duplicate package checker plugin #1496
Conversation
Walkthrough此次更改引入了一个新的重复包检查器插件,增强了编译器功能以检测和管理模块中的重复包。更新包括新增的配置选项和结构,使用户能够自定义重复包检查的行为。同时,新增的依赖关系提升了版本管理的能力。 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Config
participant Compiler
participant Plugin
participant ModuleGraph
User->>Config: 设置重复包选项
Config->>Compiler: 传递配置
Compiler->>Plugin: 初始化 DuplicatePackageCheckerPlugin
Plugin->>ModuleGraph: 分析模块以查找重复项
Plugin-->>User: 报告发现的重复包
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (8)
- crates/mako/Cargo.toml (1 hunks)
- crates/mako/src/compiler.rs (1 hunks)
- crates/mako/src/config/config.rs (4 hunks)
- crates/mako/src/plugins/duplicate_package_checker.rs (1 hunks)
- crates/mako/src/plugins/mod.rs (1 hunks)
- examples/duplicate-package/index.ts (1 hunks)
- examples/duplicate-package/mako.config.json (1 hunks)
- examples/duplicate-package/package.json (1 hunks)
Files skipped from review due to trivial changes (3)
- examples/duplicate-package/index.ts
- examples/duplicate-package/mako.config.json
- examples/duplicate-package/package.json
Additional comments not posted (14)
crates/mako/src/plugins/mod.rs (1)
6-6
: 模块添加成功。新的公共模块
duplicate_package_checker
已成功添加到插件列表中。crates/mako/Cargo.toml (1)
106-106
: 依赖项添加成功。
semver
版本1.0.23
已成功添加,可能用于改进语义版本控制。crates/mako/src/plugins/duplicate_package_checker.rs (8)
15-20
: 结构体定义良好。
PackageInfo
结构体定义合理,字段类型合适。
22-26
: 结构体定义良好。
DuplicatePackageCheckerPlugin
结构体定义合理,字段类型合适。
28-35
: 默认实现良好。
DuplicatePackageCheckerPlugin
的Default
实现正确初始化了字段。
38-54
: 函数实现良好。
read_package_info
函数正确处理了 JSON 解析和错误处理。
56-63
: 函数实现良好。
clean_path
函数有效地规范了路径,提高了可读性。
65-77
: 函数实现良好。
clean_path_relative_to_context
函数正确计算了相对路径并处理了边界情况。
128-142
: 方法实现良好。
check_duplicates
方法有效地读取了包信息并识别了重复项。
145-188
: 插件实现良好。
DuplicatePackageCheckerPlugin
的Plugin
实现正确地将插件集成到构建过程中,并处理了重复报告。crates/mako/src/compiler.rs (1)
258-265
: 集成重复包检查插件在
Compiler
的实现中引入了新的条件块,用于检查check_duplicate_package
配置选项是否存在。如果存在,则创建DuplicatePackageCheckerPlugin
的实例,并根据配置对象的参数进行配置。这一逻辑增强了编译器的功能,使其能够利用插件来检查重复包,从而提升包管理的完整性。请确保所有相关配置参数(如
show_help
、emit_error
、verbose
)在配置文件中正确设置,并且插件能够正确处理这些参数。Verification successful
验证成功:
check_duplicate_package
配置参数的使用在代码库中,
check_duplicate_package
配置参数的使用与新逻辑一致。它在crates/mako/src/compiler.rs
中用于条件性地添加插件,并在crates/mako/src/config/config.rs
中定义了反序列化函数以确保正确读取配置。确认所有相关配置参数(如show_help
、emit_error
、verbose
)在配置文件中正确设置,并且插件能够正确处理这些参数。
crates/mako/src/compiler.rs
: 使用check_duplicate_package
配置参数。crates/mako/src/config/config.rs
: 定义check_duplicate_package
的反序列化。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: 检查 `check_duplicate_package` 配置参数的使用情况。 # Test: 搜索 `check_duplicate_package` 在代码库中的使用情况。预期:所有使用都与新逻辑一致。 rg --type rust -A 5 'check_duplicate_package'Length of output: 1663
crates/mako/src/config/config.rs (3)
96-99
: 创建重复包检查配置的反序列化函数引入了
deserialize_check_duplicate_package
函数,用于处理DuplicatePackageCheckerConfig
的反序列化。这个函数允许配置项为false
时返回None
,并尝试从 JSON 对象或字符串中反序列化。请确保此函数在配置文件的解析过程中被正确调用,并且能够处理所有可能的输入格式。
268-276
: 定义重复包检查器配置结构新增的
DuplicatePackageCheckerConfig
结构体包含三个布尔字段:verbose
、emit_error
和show_help
。这些字段使用 Serde 的属性进行默认值初始化。请确保这些字段在配置文件中有合理的默认值,并且在使用时能够正确反映用户的配置意图。
747-751
: 更新默认配置以包含重复包检查器在默认配置字符串中添加了
duplicatePackageChecker
部分,并为新引入的字段提供了默认值。请确保这些默认值与项目的需求一致,并且在配置文件中没有被其他设置覆盖。
|
82b981a
to
7df6dc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (13)
Cargo.lock
is excluded by!**/*.lock
crates/mako/test/build/duplicate-package/node_modules/a/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/a/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/node_modules/a/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/node_modules/a/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/node_modules/b/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/node_modules/b/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/package.json
is excluded by!**/node_modules/**
Files selected for processing (9)
- crates/mako/Cargo.toml (1 hunks)
- crates/mako/src/compiler.rs (1 hunks)
- crates/mako/src/config/config.rs (4 hunks)
- crates/mako/src/plugins/duplicate_package_checker.rs (1 hunks)
- crates/mako/src/plugins/mod.rs (1 hunks)
- crates/mako/test/build/duplicate-package/index.ts (1 hunks)
- crates/mako/test/build/duplicate-package/mako.config.json (1 hunks)
- crates/mako/test/build/duplicate-package/package.json (1 hunks)
- e2e/fixtures/tree-shaking.failed.remove-unused-imports/expect.js (1 hunks)
Files skipped from review due to trivial changes (3)
- crates/mako/test/build/duplicate-package/index.ts
- crates/mako/test/build/duplicate-package/package.json
- e2e/fixtures/tree-shaking.failed.remove-unused-imports/expect.js
Files skipped from review as they are similar to previous changes (5)
- crates/mako/Cargo.toml
- crates/mako/src/compiler.rs
- crates/mako/src/config/config.rs
- crates/mako/src/plugins/duplicate_package_checker.rs
- crates/mako/src/plugins/mod.rs
Additional comments not posted (1)
crates/mako/test/build/duplicate-package/mako.config.json (1)
1-6
: 配置文件结构正确该 JSON 配置文件定义了一个简单有效的结构,包含两个选项:
verbose
和showHelp
。将这两个选项设置为true
可以帮助用户获取详细输出和帮助信息,便于调试和理解插件的工作原理。这对于开发阶段尤其有用。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- crates/mako/Cargo.toml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- crates/mako/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- crates/mako/Cargo.toml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- crates/mako/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (13)
Cargo.lock
is excluded by!**/*.lock
crates/mako/test/build/duplicate-package/node_modules/a/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/a/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/node_modules/a/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/node_modules/a/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/node_modules/b/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/node_modules/b/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/package.json
is excluded by!**/node_modules/**
Files selected for processing (9)
- crates/mako/Cargo.toml (1 hunks)
- crates/mako/src/compiler.rs (1 hunks)
- crates/mako/src/config/config.rs (4 hunks)
- crates/mako/src/plugins/duplicate_package_checker.rs (1 hunks)
- crates/mako/src/plugins/mod.rs (1 hunks)
- crates/mako/test/build/duplicate-package/index.ts (1 hunks)
- crates/mako/test/build/duplicate-package/mako.config.json (1 hunks)
- crates/mako/test/build/duplicate-package/package.json (1 hunks)
- e2e/fixtures/tree-shaking.failed.remove-unused-imports/expect.js (1 hunks)
Files skipped from review due to trivial changes (4)
- crates/mako/test/build/duplicate-package/index.ts
- crates/mako/test/build/duplicate-package/mako.config.json
- crates/mako/test/build/duplicate-package/package.json
- e2e/fixtures/tree-shaking.failed.remove-unused-imports/expect.js
Files skipped from review as they are similar to previous changes (4)
- crates/mako/Cargo.toml
- crates/mako/src/config/config.rs
- crates/mako/src/plugins/duplicate_package_checker.rs
- crates/mako/src/plugins/mod.rs
Additional comments not posted (1)
crates/mako/src/compiler.rs (1)
258-265
: 确保插件集成正确并记录配置选项。添加的条件块检查
check_duplicate_package
配置,并初始化DuplicatePackageCheckerPlugin
。请确保插件已正确集成,并且配置选项如show_help
、emit_error
和verbose
已在文档中详细说明。请确认插件的集成是否正确,并确保配置选项在文档中有详细说明。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- crates/mako/Cargo.toml (1 hunks)
Files skipped from review due to trivial changes (1)
- crates/mako/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在 config.md 和 config.zh-CN.md 里补充下 duplicatePackageChecker
配置的文档,其他没问题了。
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
docs/config.zh-CN.md (1)
767-790
: 检查标点符号和一致性在子配置项列表中,每个子项的描述后面建议加上句号,以保持与其他配置项的一致性。
使用以下diff来修正标点符号:
- - `verbose`:是否输出详细信息。 - - `showHelp`:是否显示帮助信息。 - - `emitError`:发现重复包时是否抛出错误。 + - `verbose`:是否输出详细信息。 + - `showHelp`:是否显示帮助信息。 + - `emitError`:发现重复包时是否抛出错误。docs/config.md (1)
767-790
: Ensure punctuation consistencyIn the list of child configuration items, it is recommended to add periods at the end of each description to maintain consistency with other configuration items.
Use the following diff to correct punctuation:
- - `verbose`: Whether to output detailed information. - - `showHelp`: Whether to show help information. - - `emitError`: Whether to emit an error when duplicate packages are found. + - `verbose`: Whether to output detailed information. + - `showHelp`: Whether to show help information. + - `emitError`: Whether to emit an error when duplicate packages are found.Tools
LanguageTool
[uncategorized] ~776-~776: Loose punctuation mark.
Context: ... Child configuration items: -verbose
: Whether to output detailed information....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~777-~777: Loose punctuation mark.
Context: ...utput detailed information. -showHelp
: Whether to show help information. - `em...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~778-~778: Loose punctuation mark.
Context: ... to show help information. -emitError
: Whether to emit an error when duplicate...(UNLIKELY_OPENING_PUNCTUATION)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (13)
Cargo.lock
is excluded by!**/*.lock
crates/mako/test/build/duplicate-package/node_modules/a/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/a/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/node_modules/a/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/node_modules/a/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/b/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/node_modules/b/index.js
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/node_modules/b/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/node_modules/d/package.json
is excluded by!**/node_modules/**
crates/mako/test/build/duplicate-package/node_modules/c/package.json
is excluded by!**/node_modules/**
Files selected for processing (11)
- crates/mako/Cargo.toml (1 hunks)
- crates/mako/src/compiler.rs (1 hunks)
- crates/mako/src/config/config.rs (4 hunks)
- crates/mako/src/plugins/duplicate_package_checker.rs (1 hunks)
- crates/mako/src/plugins/mod.rs (1 hunks)
- crates/mako/test/build/duplicate-package/index.ts (1 hunks)
- crates/mako/test/build/duplicate-package/mako.config.json (1 hunks)
- crates/mako/test/build/duplicate-package/package.json (1 hunks)
- docs/config.md (1 hunks)
- docs/config.zh-CN.md (1 hunks)
- e2e/fixtures/tree-shaking.failed.remove-unused-imports/expect.js (1 hunks)
Files skipped from review due to trivial changes (5)
- crates/mako/Cargo.toml
- crates/mako/test/build/duplicate-package/index.ts
- crates/mako/test/build/duplicate-package/mako.config.json
- crates/mako/test/build/duplicate-package/package.json
- e2e/fixtures/tree-shaking.failed.remove-unused-imports/expect.js
Files skipped from review as they are similar to previous changes (4)
- crates/mako/src/compiler.rs
- crates/mako/src/config/config.rs
- crates/mako/src/plugins/duplicate_package_checker.rs
- crates/mako/src/plugins/mod.rs
Additional context used
LanguageTool
docs/config.md
[uncategorized] ~776-~776: Loose punctuation mark.
Context: ... Child configuration items: -verbose
: Whether to output detailed information....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~777-~777: Loose punctuation mark.
Context: ...utput detailed information. -showHelp
: Whether to show help information. - `em...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~778-~778: Loose punctuation mark.
Context: ... to show help information. -emitError
: Whether to emit an error when duplicate...(UNLIKELY_OPENING_PUNCTUATION)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
docs/config.md (1)
784-786
: 建议修复标点符号问题。在子配置项的列表中,标点符号使用不当。建议在每个列表项后添加句号以保持一致性。
使用以下 diff 修复标点符号:
- `verbose`: Whether to output detailed information. - `showHelp`: Whether to show help information. - `emitError`: Whether to emit an error when duplicate packages are found. + `verbose`: Whether to output detailed information. + `showHelp`: Whether to show help information. + `emitError`: Whether to emit an error when duplicate packages are found.Tools
LanguageTool
[uncategorized] ~784-~784: Loose punctuation mark.
Context: ... Child configuration items: -verbose
: Whether to output detailed information....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~785-~785: Loose punctuation mark.
Context: ...utput detailed information. -showHelp
: Whether to show help information. - `em...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~786-~786: Loose punctuation mark.
Context: ... to show help information. -emitError
: Whether to emit an error when duplicate...(UNLIKELY_OPENING_PUNCTUATION)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (3)
- crates/mako/Cargo.toml (1 hunks)
- docs/config.md (1 hunks)
- docs/config.zh-CN.md (1 hunks)
Files skipped from review due to trivial changes (1)
- crates/mako/Cargo.toml
Files skipped from review as they are similar to previous changes (1)
- docs/config.zh-CN.md
Additional context used
LanguageTool
docs/config.md
[uncategorized] ~784-~784: Loose punctuation mark.
Context: ... Child configuration items: -verbose
: Whether to output detailed information....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~785-~785: Loose punctuation mark.
Context: ...utput detailed information. -showHelp
: Whether to show help information. - `em...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~786-~786: Loose punctuation mark.
Context: ... to show help information. -emitError
: Whether to emit an error when duplicate...(UNLIKELY_OPENING_PUNCTUATION)
Additional comments not posted (1)
docs/config.md (1)
790-798
: 示例配置良好。示例 JSON 配置清晰明了,增强了文档的可用性。
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1496 +/- ##
==========================================
+ Coverage 60.91% 61.52% +0.61%
==========================================
Files 126 127 +1
Lines 15135 15253 +118
==========================================
+ Hits 9219 9385 +166
+ Misses 5916 5868 -48 ☔ View full report in Codecov by Sentry. |
由于 #1524 的改动,还需要 merge master 修下冲突。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- crates/mako/src/plugins.rs (1 hunks)
- docs/config.zh-CN.md (2 hunks)
Additional context used
Markdownlint
docs/config.zh-CN.md
800-800: null
Multiple headings with the same content(MD024, no-duplicate-heading)
Additional comments not posted (2)
crates/mako/src/plugins.rs (1)
6-6
: 模块声明已添加。已成功添加
duplicate_package_checker
模块声明,增强了对重复包的检测能力。docs/config.zh-CN.md (1)
164-187
: 已添加重复包检查器配置。成功添加了
duplicatePackageChecker
配置,详细说明了其子配置项和用法示例。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- docs/config.zh-CN.md (2 hunks)
Additional context used
Markdownlint
docs/config.zh-CN.md
800-800: null
Multiple headings with the same content(MD024, no-duplicate-heading)
Additional comments not posted (2)
docs/config.zh-CN.md (2)
800-800
: 重复标题问题。文档中存在重复的标题,建议合并或修改以避免混淆。
Tools
Markdownlint
800-800: null
Multiple headings with the same content(MD024, no-duplicate-heading)
164-187
: 文档更新通过!
duplicatePackageChecker
的配置文档清晰明了,示例也很有帮助。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
docs/config.zh-CN.md (1)
800-800
: 重复标题问题。文档中存在重复的标题,建议合并或修改以避免混淆。
- ### duplicatePackageChecker
Tools
Markdownlint
800-800: null
Multiple headings with the same content(MD024, no-duplicate-heading)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- docs/config.zh-CN.md (2 hunks)
Additional context used
Markdownlint
docs/config.zh-CN.md
800-800: null
Multiple headings with the same content(MD024, no-duplicate-heading)
Additional comments not posted (2)
docs/config.zh-CN.md (2)
164-187
: 配置项顺序问题。配置项的顺序需要按字母排序,比如
duplicatePackageChecker
需要排在d
前后。
164-187
: 新增配置项duplicatePackageChecker
。新增的配置项
duplicatePackageChecker
详细说明了其类型、默认值及子配置项,文档清晰易懂。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- crates/mako/Cargo.toml (1 hunks)
Files skipped from review due to trivial changes (1)
- crates/mako/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- crates/mako/Cargo.toml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- crates/mako/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- crates/mako/src/config/config.rs (4 hunks)
- docs/config.md (2 hunks)
- docs/config.zh-CN.md (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- crates/mako/src/config/config.rs
- docs/config.zh-CN.md
Additional context used
LanguageTool
docs/config.md
[uncategorized] ~173-~173: Loose punctuation mark.
Context: ... Child configuration items: -verbose
: Whether to output detailed information....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~174-~174: Loose punctuation mark.
Context: ...utput detailed information. -showHelp
: Whether to show help information. - `em...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~175-~175: Loose punctuation mark.
Context: ... to show help information. -emitError
: Whether to emit an error when duplicate...(UNLIKELY_OPENING_PUNCTUATION)
Additional comments not posted (5)
docs/config.md (5)
164-165
: 新增配置项:duplicatePackageChecker
新增的配置项
duplicatePackageChecker
用于重复包检查器的配置。新增配置项描述清晰,符合文档规范。
166-167
: 配置项类型和默认值
- 类型:
{ verbose: boolean, showHelp: boolean, emitError: boolean } | false
- 默认值:
false
配置项类型和默认值描述准确。
169-169
: 配置项描述配置项
duplicatePackageChecker
的描述。描述清晰,符合文档规范。
171-175
: 子配置项描述
verbose
: 是否输出详细信息。showHelp
: 是否显示帮助信息。emitError
: 是否在发现重复包时发出错误。子配置项描述清晰,符合文档规范。
Tools
LanguageTool
[uncategorized] ~173-~173: Loose punctuation mark.
Context: ... Child configuration items: -verbose
: Whether to output detailed information....(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~174-~174: Loose punctuation mark.
Context: ...utput detailed information. -showHelp
: Whether to show help information. - `em...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~175-~175: Loose punctuation mark.
Context: ... to show help information. -emitError
: Whether to emit an error when duplicate...(UNLIKELY_OPENING_PUNCTUATION)
177-187
: 配置示例提供了一个 JSON 格式的配置示例,展示了如何配置
duplicatePackageChecker
。示例清晰,便于用户理解和使用。
close #1491
Summary by CodeRabbit
新功能
文档