Skip to content

doc: contribute guidelines: Explain when not to use clang-format #73465

@Snevzor

Description

@Snevzor

Is your enhancement proposal related to a problem? Please describe.
Running clang-format on a file with old code that doesn't follow the current coding style makes a substantial code change unreviewable, unless clang-format is performed beforehand and put in a separate commit that can be skipped faster by
the reviewers. The change (new code) can now easily be reformatted by clang-format too before committing.
With #73360 I experienced this is actually not desired.

Describe the solution you'd like
Update https://docs.zephyrproject.org/latest/contribute/guidelines.html#clang-format to explain why reformatting old code before adding the changes is not desired and add what to do in this situation. The new code should adhere to the current coding style, even if it deviates from the style used in the c file?

Perhaps some small examples can be added.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions