-
Notifications
You must be signed in to change notification settings - Fork 121
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
IEP-1277 Create .clang_format #1022
Conversation
Warning Rate limit exceeded@sigmaaa has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 19 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughThis update enhances Clang file management within the project framework. It introduces a new constant, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Wizard as NewIDFProjectWizard
participant ConfigHandler as ClangFormatFileHandler
participant Build as IDFBuildConfiguration
User->>Wizard: Create new project
Wizard->>ConfigHandler: Update Clang files
ConfigHandler-->>Wizard: Ensure .clang-format exists
Wizard->>Build: Trigger build process
Build->>ConfigHandler: Call update for formatting
Build-->>User: Complete project setup
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 selected for processing (5)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/ILSPConstants.java (1 hunks)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (2 hunks)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java (1 hunks)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java (1 hunks)
- bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (3 hunks)
Files skipped from review due to trivial changes (1)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/LspService.java
Additional comments not posted (10)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/ILSPConstants.java (1)
14-14
: Add a new constant for.clang-format
file.The new constant
CLANG_FORMAT_FILE
is consistent with the existing constants and follows the same pattern.bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java (5)
29-32
: Constructor initializes fields correctly.The constructor correctly initializes the
project
andclangFormatPath
fields.
40-50
: Methodupdate
handles file creation and updating correctly.The method correctly handles the creation and updating of the
.clang-format
file with default settings.
52-57
: MethodcreateYamlOptions
sets YAML formatting options correctly.The method correctly sets the
DumperOptions
for YAML formatting.
59-63
: MethodwriteYamlFile
writes data to the file correctly.The method correctly writes the provided data to the
.clang-format
file using YAML format.
73-86
: MethodcreateNewClangFormatFile
handles file creation and existence check correctly.The method correctly ensures the
.clang-format
file exists and creates it if it does not, with appropriate error handling and project refresh.bundles/com.espressif.idf.ui/src/com/espressif/idf/ui/wizard/NewIDFProjectWizard.java (2)
114-114
: Call toupdateClangFiles
is correct.The method now correctly calls
updateClangFiles
instead ofupdateClangdFile
.
145-150
: MethodupdateClangFiles
correctly handles updating Clangd and Clang format files.The method now correctly includes the
ClangFormatFileHandler
to update the.clang-format
file, with appropriate error handling.bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (2)
88-88
: Import statement forClangFormatFileHandler
looks good.The import statement is correctly added and necessary for the new functionality.
343-343
: Integration ofClangFormatFileHandler
in the build process looks good.The new instance and method call are correctly placed to enhance the build process. Ensure that the
update
method handles errors gracefully.
@sigmaaa hi ! Tested under: Creating the .clang-format file with the default settings with a new project. ✔️ .clangd-format file works. do see content:
added LGTM 👍 |
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 (2)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/.clang-format-project (1 hunks)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java (1 hunks)
Files skipped from review due to trivial changes (1)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/.clang-format-project
Additional comments not posted (3)
bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java (3)
1-15
: LGTM!The class definition and imports look good.
16-22
: LGTM!The constructor correctly initializes the
clangFormatFile
field.
23-39
: LGTM!The
update
method correctly handles the creation of the.clang-format
file and includes proper exception handling.
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)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/util/ClangFormatFileHandler.java
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.
LGTM
Description
Creating the .clang-format file with the default settings with a new project. Also, if .clang-format file is missing, it's adding automatically after the build
Fixes # (IEP-1277)
Type of change
Please delete options that are not relevant.
How has this been tested?
Test Configuration:
Dependent components impacted by this PR:
Checklist
Summary by CodeRabbit
New Features
.clang-format
file to streamline formatting setup in projects.Bug Fixes