ostree icon indicating copy to clipboard operation
ostree copied to clipboard

Add .clang-format file + tree-wide: Run `clang-format`

Open cgwalters opened this issue 2 years ago • 9 comments

Add .clang-format file

In rpm-ostree we recently did a tree-wide clang-format: https://github.com/coreos/rpm-ostree/pull/3475

This adopts the exact same style.

The core motivation here is making it easier for contributors to match the indentation style.


tree-wide: Run clang-format

To keep things consistent going forward.


cgwalters avatar Mar 11 '22 20:03 cgwalters

(This needs some work to compile, leaving as draft for discussion anyways since we should get outstanding patches in first)

cgwalters avatar Mar 11 '22 20:03 cgwalters

:+1: from me. This is disruptive, but worth it long-term.

(Also, for anyone not familiar, check out git log -S if you don't use it yet. It'll often get you to the commit you're interested in faster than iteratively using git annotate.)

jlebon avatar Mar 14 '22 19:03 jlebon

@cgwalters: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openshift-ci[bot] avatar Mar 16 '22 11:03 openshift-ci[bot]

@cgwalters: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/sanity 386afc2c4a711558d5dad9f76d5eea3c74469e91 link true /test sanity

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Apr 06 '22 20:04 openshift-ci[bot]

If we do this, we probably also want to do the same thing as in https://github.com/coreos/rpm-ostree/pull/3604.

jlebon avatar Apr 12 '22 20:04 jlebon

This is fine by me. I'd rather fix it all in one mega commit than hundreds of little fixes scattered in PRs.

dbnicholson avatar Jul 08 '22 14:07 dbnicholson

The other part that seems important to me is to have a workflow that enforces it. Without that people will forget to do it and we'll continue to get commits fixing up formatting.

dbnicholson avatar Jul 08 '22 14:07 dbnicholson

https://github.com/marketplace/actions/clang-format-check seems like a drop in.

dbnicholson avatar Jul 08 '22 14:07 dbnicholson

Looks like the impact to git blame can be minimized: https://mobile.twitter.com/pamelafox/status/1556779165247893506.

jlebon avatar Aug 25 '22 13:08 jlebon