Skip to content
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

Merged
merged 20 commits into from
Aug 29, 2024

Conversation

jeasonnow
Copy link
Contributor

@jeasonnow jeasonnow commented Aug 13, 2024

close #1491

Summary by CodeRabbit

  • 新功能

    • 引入了重复包检查插件,增强了包管理功能。
    • 新增配置选项,允许用户定制重复包检查的行为,包括详细输出、帮助信息显示和错误发出。
    • 添加对语义版本控制的支持,改善依赖管理。
  • 文档

    • 更新了配置文件以包含新的重复包检查设置,提供清晰的说明和配置示例。
    • 在中文文档中增加了重复包检查配置的相关信息。

Copy link
Contributor

coderabbitai bot commented Aug 13, 2024

Walkthrough

此次更改引入了一个新的重复包检查器插件,增强了编译器功能以检测和管理模块中的重复包。更新包括新增的配置选项和结构,使用户能够自定义重复包检查的行为。同时,新增的依赖关系提升了版本管理的能力。

Changes

文件 更改摘要
crates/mako/Cargo.toml 新增依赖 semver 版本 1.0.23
docs/config.md, docs/config.zh-CN.md 新增 duplicatePackageChecker 配置部分及说明
crates/mako/src/plugins/duplicate_package_checker.rs 新增 DuplicatePackageCheckerPlugin 插件及其相关功能实现
crates/mako/src/plugins.rs 新增模块 duplicate_package_checker 声明
crates/mako/src/config/config.rs 新增 DuplicatePackageCheckerConfig 结构及其集成

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: 报告发现的重复包
Loading

Assessment against linked issues

Objective Addressed Explanation
实现重复包检查功能 #1491
提供用户自定义配置选项
确保与现有功能的兼容性

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between bdd09fa and fdc0302.

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: 默认实现良好。

DuplicatePackageCheckerPluginDefault 实现正确初始化了字段。


38-54: 函数实现良好。

read_package_info 函数正确处理了 JSON 解析和错误处理。


56-63: 函数实现良好。

clean_path 函数有效地规范了路径,提高了可读性。


65-77: 函数实现良好。

clean_path_relative_to_context 函数正确计算了相对路径并处理了边界情况。


128-142: 方法实现良好。

check_duplicates 方法有效地读取了包信息并识别了重复项。


145-188: 插件实现良好。

DuplicatePackageCheckerPluginPlugin 实现正确地将插件集成到构建过程中,并处理了重复报告。

crates/mako/src/compiler.rs (1)

258-265: 集成重复包检查插件

Compiler 的实现中引入了新的条件块,用于检查 check_duplicate_package 配置选项是否存在。如果存在,则创建 DuplicatePackageCheckerPlugin 的实例,并根据配置对象的参数进行配置。这一逻辑增强了编译器的功能,使其能够利用插件来检查重复包,从而提升包管理的完整性。

请确保所有相关配置参数(如 show_helpemit_errorverbose)在配置文件中正确设置,并且插件能够正确处理这些参数。

Verification successful

验证成功:check_duplicate_package 配置参数的使用

在代码库中,check_duplicate_package 配置参数的使用与新逻辑一致。它在 crates/mako/src/compiler.rs 中用于条件性地添加插件,并在 crates/mako/src/config/config.rs 中定义了反序列化函数以确保正确读取配置。确认所有相关配置参数(如 show_helpemit_errorverbose)在配置文件中正确设置,并且插件能够正确处理这些参数。

  • 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 结构体包含三个布尔字段:verboseemit_errorshow_help。这些字段使用 Serde 的属性进行默认值初始化。

请确保这些字段在配置文件中有合理的默认值,并且在使用时能够正确反映用户的配置意图。


747-751: 更新默认配置以包含重复包检查器

在默认配置字符串中添加了 duplicatePackageChecker 部分,并为新引入的字段提供了默认值。

请确保这些默认值与项目的需求一致,并且在配置文件中没有被其他设置覆盖。

@sorrycc
Copy link
Member

sorrycc commented Aug 19, 2024

  1. CI is broken, please run just ready locally
  2. Please post the log result when running it with project containing duplicate packages

@jeasonnow jeasonnow force-pushed the feat/1491 branch 3 times, most recently from 82b981a to 7df6dc3 Compare August 19, 2024 05:17
@jeasonnow
Copy link
Contributor Author

image

@jeasonnow jeasonnow changed the title WIP: feat: #1491 add duplicate package checker plugin feat: #1491 add duplicate package checker plugin Aug 19, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between fdc0302 and 7df6dc3.

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 配置文件定义了一个简单有效的结构,包含两个选项:verboseshowHelp。将这两个选项设置为 true 可以帮助用户获取详细输出和帮助信息,便于调试和理解插件的工作原理。这对于开发阶段尤其有用。

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 7df6dc3 and 593ab8a.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 593ab8a and fa9a7c1.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between fa9a7c1 and 46624d0.

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_helpemit_errorverbose 已在文档中详细说明。

请确认插件的集成是否正确,并确保配置选项在文档中有详细说明。

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 46624d0 and 5f6f8b9.

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

Copy link
Member

@sorrycc sorrycc left a 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 配置的文档,其他没问题了。

@jeasonnow
Copy link
Contributor Author

在 config.md 和 config.zh-CN.md 里补充下 duplicatePackageChecker 配置的文档,其他没问题了。

done

@jeasonnow jeasonnow requested a review from sorrycc August 21, 2024 10:04
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 consistency

In 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

Commits

Files that changed from the base of the PR and between 5f6f8b9 and 9b992ef.

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)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 9b992ef and 3d04a08.

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 配置清晰明了,增强了文档的可用性。

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 88.98305% with 13 lines in your changes missing coverage. Please review.

Project coverage is 61.52%. Comparing base (ee2531f) to head (30c913f).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...ates/mako/src/plugins/duplicate_package_checker.rs 92.23% 8 Missing ⚠️
crates/mako/src/config/config.rs 44.44% 5 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@jeasonnow jeasonnow requested a review from sorrycc August 23, 2024 02:32
@sorrycc
Copy link
Member

sorrycc commented Aug 23, 2024

由于 #1524 的改动,还需要 merge master 修下冲突。

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between ef69802 and fba1270.

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 配置,详细说明了其子配置项和用法示例。

docs/config.zh-CN.md Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between fba1270 and 4357689.

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 的配置文档清晰明了,示例也很有帮助。

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 4357689 and bfb3683.

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 详细说明了其类型、默认值及子配置项,文档清晰易懂。

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between bfb3683 and 836310a.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 836310a and 332863f.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 332863f and 2c76cc0.

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

示例清晰,便于用户理解和使用。

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.

Duplicate package checker
4 participants