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

chore: prettier all code #1063

Merged
merged 3 commits into from
Aug 31, 2024
Merged

chore: prettier all code #1063

merged 3 commits into from
Aug 31, 2024

Conversation

afc163
Copy link
Member

@afc163 afc163 commented Aug 31, 2024

Summary by CodeRabbit

  • 新功能

    • 添加了新的脚本以运行 Prettier 代码格式化工具,确保代码一致性。
    • 更新了 lint 脚本,以包括测试目录,提升代码质量检查。
  • 样式

    • 改进了多个文件中的代码格式和可读性,包括调整箭头函数的参数括号和多行格式。
    • 在多个示例文件中进行了小幅格式调整,以增强代码的清晰度。
  • 文档

    • 更新了 README 文件中的组件属性文档格式,提升可读性。
  • 测试

    • 修改了测试文件中的格式,去除不必要的空行,增强可读性。

Copy link

vercel bot commented Aug 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
select ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 3:16pm

Copy link
Contributor

coderabbitai bot commented Aug 31, 2024

Warning

Rate limit exceeded

@afc163 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 16 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 1064bb1 and c375d7b.

Walkthrough

此次更改涉及多个配置文件和示例组件的格式调整,主要集中在代码的可读性和一致性上。修改包括引号样式、参数括号的使用、文件末尾换行符的添加,以及部分脚本的更新。整体上,功能和逻辑保持不变,主要是为了提升代码的整洁性和维护性。

Changes

文件路径 更改摘要
.github/dependabot.yml 调整YAML格式,使用单引号,优化缩进。
.github/workflows/codeql.yml 修改引号样式,调整数组语法格式。
.prettierrc 在文件末尾添加换行符。
HISTORY.md 在文件末尾添加换行符。
README.md 优化文档格式,移除表格行前的多余空格。
docs/examples/*.tsx 多处调整箭头函数参数的括号,改善代码可读性。
docs/examples/common.less 在文件末尾添加换行符。
docs/examples/common/tbFetchSuggest.tsx 改善箭头函数参数的括号使用。
docs/examples/controlled.tsx 多处添加箭头函数参数的括号,提升一致性。
docs/examples/custom-tags.tsx 移除导入语句与代码块之间的空行。
docs/examples/dropdownRender.tsx 修改dropdownRender的箭头函数参数格式。
docs/examples/email.tsx 更新方法声明,添加箭头函数参数的括号。
docs/examples/filterSort.tsx 修改Select组件的闭合标签格式。
docs/examples/force-suggest.tsx 多处添加箭头函数参数的括号,提升可读性。
docs/examples/loading.tsx 修改onBlur事件处理器的箭头函数格式。
docs/examples/optgroup.tsx 调整options数组的格式以提高可读性。
docs/examples/single.tsx 多处添加箭头函数参数的括号,改善代码一致性。
docs/examples/update-option.tsx 更新updateOptions方法的箭头函数参数格式。
now.json 在文件末尾添加换行符。
package.json 新增prettier脚本,更新lint脚本以包含tests目录。
src/Selector/MultipleSelector.tsx 优化tagRender函数调用的参数格式。
src/Selector/index.tsx 改善Selector组件的条件逻辑格式。
tests/Combobox.test.tsx 调整测试用例格式,移除多余空行。
tests/shared/maxTagRenderTest.tsx 简化maxTagPlaceholder函数实现,调整expect语句格式。
tsconfig.json 合并paths部分的数组声明,优化格式。

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Component
    participant Logic

    User->>Component: 触发事件
    Component->>Logic: 处理事件
    Logic-->>Component: 返回结果
    Component-->>User: 更新界面
Loading

🐰

在代码的每个角落,
格式更整齐,读起来更快乐。
括号加上,清晰如水,
兔子欢跳,代码如歌。
让我们庆祝这美好变化,
维护性强,开发无忧愁!
🐇


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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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

codecov bot commented Aug 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.21%. Comparing base (11ae2ad) to head (c375d7b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1063   +/-   ##
=======================================
  Coverage   98.21%   98.21%           
=======================================
  Files          39       39           
  Lines        1458     1460    +2     
  Branches      435      438    +3     
=======================================
+ Hits         1432     1434    +2     
  Misses         26       26           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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 11ae2ad and 1064bb1.

Files selected for processing (26)
  • .github/dependabot.yml (1 hunks)
  • .github/workflows/codeql.yml (3 hunks)
  • .prettierrc (1 hunks)
  • HISTORY.md (1 hunks)
  • README.md (1 hunks)
  • docs/examples/auto-adjust-dropdown.tsx (3 hunks)
  • docs/examples/combobox.tsx (2 hunks)
  • docs/examples/common.less (1 hunks)
  • docs/examples/common/tbFetchSuggest.tsx (1 hunks)
  • docs/examples/controlled.tsx (3 hunks)
  • docs/examples/custom-tags.tsx (1 hunks)
  • docs/examples/dropdownRender.tsx (1 hunks)
  • docs/examples/email.tsx (1 hunks)
  • docs/examples/filterSort.tsx (1 hunks)
  • docs/examples/force-suggest.tsx (2 hunks)
  • docs/examples/loading.tsx (1 hunks)
  • docs/examples/optgroup.tsx (1 hunks)
  • docs/examples/single.tsx (5 hunks)
  • docs/examples/update-option.tsx (2 hunks)
  • now.json (1 hunks)
  • package.json (1 hunks)
  • src/Selector/MultipleSelector.tsx (1 hunks)
  • src/Selector/index.tsx (1 hunks)
  • tests/Combobox.test.tsx (2 hunks)
  • tests/shared/maxTagRenderTest.tsx (2 hunks)
  • tsconfig.json (1 hunks)
Files skipped from review due to trivial changes (24)
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .prettierrc
  • README.md
  • docs/examples/auto-adjust-dropdown.tsx
  • docs/examples/combobox.tsx
  • docs/examples/common.less
  • docs/examples/common/tbFetchSuggest.tsx
  • docs/examples/controlled.tsx
  • docs/examples/custom-tags.tsx
  • docs/examples/dropdownRender.tsx
  • docs/examples/email.tsx
  • docs/examples/filterSort.tsx
  • docs/examples/force-suggest.tsx
  • docs/examples/loading.tsx
  • docs/examples/optgroup.tsx
  • docs/examples/single.tsx
  • docs/examples/update-option.tsx
  • now.json
  • src/Selector/MultipleSelector.tsx
  • src/Selector/index.tsx
  • tests/Combobox.test.tsx
  • tests/shared/maxTagRenderTest.tsx
  • tsconfig.json
Additional context used
Markdownlint
HISTORY.md

1-1: null
Bare URL used

(MD034, no-bare-urls)

Additional comments not posted (2)
package.json (2)

38-38: 新增 Prettier 脚本

添加了新的 "prettier" 脚本,用于运行 Prettier 代码格式化工具,忽略未知文件类型。这是一个积极的改变,有助于保持代码库的一致性。


39-39: 更新 Lint 脚本

"lint" 脚本已更新,包括 "tests" 目录。这是一个好的实践,有助于确保包括测试文件在内的所有代码的质量。

运行以下脚本以验证 "tests" 目录是否正确包含在 linting 过程中:

Verification successful

验证成功:Lint 脚本已正确更新

"lint" 脚本确实包含了 "tests" 目录,确保了测试文件的代码质量。此更改已在 package.json 中得到确认。

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证 "tests" 目录是否被包含在 linting 过程中。

# 测试:搜索 lint 脚本配置。预期:包含 "tests" 目录。
rg --type json -A 5 $'"lint": "eslint src/ docs/ tests/ --ext .tsx,.ts,.jsx,.js"'

Length of output: 331

HISTORY.md Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@afc163 afc163 merged commit e9c42a9 into master Aug 31, 2024
7 of 8 checks passed
@afc163 afc163 deleted the chore/prettier-code branch August 31, 2024 15:15
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.

1 participant