-
Notifications
You must be signed in to change notification settings - Fork 30
[script] format shell scripts with make-pretty #126
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
Conversation
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.
Summary of Changes
Hello @yangsong-cnyn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on enhancing code consistency and readability by standardizing the formatting of shell scripts throughout the repository. By leveraging shfmt through a dedicated make-pretty script, the aim is to ensure all shell scripts adhere to a uniform style, making them easier to read and maintain for current and future contributors. This initiative is purely cosmetic and does not alter any functional aspects of the codebase.
Highlights
- Shell Script Formatting: This pull request applies automatic formatting to all shell scripts in the repository using
shfmtviascript/make-pretty shell. This ensures a consistent style across all scripts. - Style-Only Change: The changes introduced are purely stylistic and have no functional impact on the behavior of the scripts or the overall repository.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request applies shfmt formatting to shell scripts, which improves code style consistency. The changes are mostly stylistic as described. I've added one suggestion in script/otbr-setup.bash to refactor a complex if condition into a case statement, which will improve readability and maintainability.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
96f0f64 to
a6e000a
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.
Pull Request Overview
This PR formats shell scripts in the repository using shfmt via the make-pretty tool to enforce consistent styling across all shell scripts. This is a style-only change with no functional impact on the codebase.
Key changes:
- Refactored duplicated configuration arrays into shared
LOCAL_OPTIONS_COMMONarrays - Converted conditional logic from
if-eliftocasestatement for better readability - Added blank lines for improved formatting consistency
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| script/otbr-setup.bash | Refactored duplicated option arrays and improved conditional structure |
| README.md | Added blank lines for consistent formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@yangsong-cnyn I noticed the CI build now gets the same build error here that I have personally - on any OS except older ones (like Ubuntu 20.04 still works). The error is as follows: This happens when the root user (started inside a chroot jail) runs a script that calls "su -c .... pi" effectively switching from root user to 'pi' user, then the pi user runs the OTBR bootstrap script, which requires sudo to elevate again to root. Here it fails. It seems something got updated, disallowing the elevation back to root, once downgraded to the pi user? |
@EskoDijk Thanks for the info. I just filed a PR #128 to address the issue |
This change formats shell scripts in the repository by running
script/make-pretty shell.This uses
shfmtto enforce a consistent style across all shell scripts. This is a style-only change with no functional impact.