Skip to content

Conversation

@yangsong-cnyn
Copy link
Contributor

This change formats shell scripts in the repository by running script/make-pretty shell.

This uses shfmt to enforce a consistent style across all shell scripts. This is a style-only change with no functional impact.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 shfmt via script/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

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

@yangsong-cnyn yangsong-cnyn requested a review from jwhui September 8, 2025 06:27
Copy link

@gemini-code-assist gemini-code-assist bot left a 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>
Copy link

Copilot AI left a 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_COMMON arrays
  • Converted conditional logic from if-elif to case statement 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.

@EskoDijk
Copy link

@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:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

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?
Maybe something in a newer Qemu, or Docker or so.

@yangsong-cnyn
Copy link
Contributor Author

@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:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

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? Maybe something in a newer Qemu, or Docker or so.

@EskoDijk Thanks for the info. I just filed a PR #128 to address the issue

@jwhui jwhui changed the title Format shell scripts with make-pretty [script] format shell scripts with make-pretty Sep 24, 2025
@jwhui jwhui merged commit b8e9668 into openthread:main Sep 24, 2025
2 checks passed
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.

3 participants