Skip to content

Add shortcuts to Pigweed formatters#2351

Draft
armandomontanez wants to merge 2 commits into
raspberrypi:developfrom
armandomontanez:add_code_formatting
Draft

Add shortcuts to Pigweed formatters#2351
armandomontanez wants to merge 2 commits into
raspberrypi:developfrom
armandomontanez:add_code_formatting

Conversation

@armandomontanez
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor Author

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
Copy link
Copy Markdown
Contributor

lurch commented Mar 13, 2025

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
Copy link
Copy Markdown
Contributor Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants