WIP: Add shortcuts to Pigweed formatters #2351

Draft
armandomontanez wants to merge 2 commits from armandomontanez/add_code_formatting into develop
armandomontanez commented 2025-03-12 15:41:21 -05:00 (Migrated from github.com)

Adds commands to easily run Pigweed's formatters:

  • bazel run //tools:format_code
  • bazel run //tools:check_code_formatting
Adds commands to easily run Pigweed's formatters: * bazel run //tools:format_code * bazel run //tools:check_code_formatting
armandomontanez commented 2025-03-12 16:03:42 -05:00 (Migrated from github.com)

Needs a .clang-format config file at the root for clang-format to pick up. I'm biased, but my suggestion would be use Pigweed's as a starting point and then just tweak options to your liking.

Needs a `.clang-format` config file at the root for `clang-format` to pick up. I'm biased, but my suggestion would be use Pigweed's as a starting point and then just tweak options to your liking.
lurch commented 2025-03-13 05:40:41 -05:00 (Migrated from github.com)

Adds commands to easily run Pigweed's formatters:

  • bazel run //tools:format_code

The comment in the code says bazelisk run //tools:format_code ?

> Adds commands to easily run Pigweed's formatters: > > * bazel run //tools:format_code The comment in the code says `bazelisk run //tools:format_code` ?
armandomontanez commented 2025-03-14 20:31:18 -05:00 (Migrated from github.com)

The right answer is bazelisk, I just have bazel as an alias for bazelisk so I have a habit of typing that.

Also, this was put up as a WIP to discuss/demo live sometime in the future. While I find it handy for formatting the Bazel build files, it can format C/C++/Python files too. (I wasn't expecting anyone to pay any mind to it while it was marked as a draft)

The right answer is `bazelisk`, I just have `bazel` as an alias for `bazelisk` so I have a habit of typing that. Also, this was put up as a WIP to discuss/demo live sometime in the future. While I find it handy for formatting the Bazel build files, it can format C/C++/Python files too. (I wasn't expecting anyone to pay any mind to it while it was marked as a draft)
This pull request has changes conflicting with the target branch.
  • .bazelrc
  • .bazelversion
  • MODULE.bazel
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'armandomontanez/add_code_formatting:armandomontanez/add_code_formatting'
git switch 'armandomontanez/add_code_formatting'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'develop'
git merge --no-ff 'armandomontanez/add_code_formatting'
git switch 'armandomontanez/add_code_formatting'
git rebase 'develop'
git switch 'develop'
git merge --ff-only 'armandomontanez/add_code_formatting'
git switch 'armandomontanez/add_code_formatting'
git rebase 'develop'
git switch 'develop'
git merge --no-ff 'armandomontanez/add_code_formatting'
git switch 'develop'
git merge --squash 'armandomontanez/add_code_formatting'
git switch 'develop'
git merge --ff-only 'armandomontanez/add_code_formatting'
git switch 'develop'
git merge 'armandomontanez/add_code_formatting'
git push origin 'develop'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!2351
No description provided.