Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-format: introduce top-level config file #816

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThomasAdam
Copy link
Member

@ThomasAdam ThomasAdam commented Jan 22, 2023

Fvwm has had a long history, with contributions from many people over the years. As a result the code formatting which has crept in is varied -- both in terms of whitespace, indentation, etc., with there being mass inconsistencies all over the code base.

Even as far back as 2006 (see commit: 1c9e17f), there was an attempt at reformatting some of FvwmButton's code, but not all of it.

Thankfully, technology exists to bring consistency to this automatically. clang-format (from llvm) is one example, but it seems to do the job well enough.

This definition cribs from FreeBSD's style, which isn't too far off the codebase as it stands at the moment.

To see what this looks like, checkout the ta/reformatted-via-clangf branch.

This was generated by limiting the code changes to fvwm's files, by running:

find fvwm libs modules -iname '*.[ch]' -exec clang-format -i --style="file:$(pwd)/.clang-format" {} \;

Things to think about:

@ThomasAdam ThomasAdam added this to the 1.0.7 milestone Jan 22, 2023
@ThomasAdam ThomasAdam added the skip:changelog Issue/PR should skip CHANGELOG label Jan 22, 2023
@ThomasAdam ThomasAdam removed this from the 1.0.7 milestone Sep 4, 2023
@ThomasAdam ThomasAdam self-assigned this Apr 5, 2024
@ThomasAdam ThomasAdam added type:enhancement Augmenting an existing feature and removed skip:changelog Issue/PR should skip CHANGELOG labels Apr 5, 2024
@ThomasAdam ThomasAdam added this to the 1.1.1 milestone Apr 5, 2024
Fvwm has had a long history, with contributions from many people over
the years.  As a result the code formatting which has crept in is varied
-- both in terms of whitespace, indentation, etc., with there being mass
inconsistencies all over the code base.

Even as far back as 2006 (see commit:
1c9e17f), there was an attempt at
reformatting some of FvwmButton's code, but not all of it.

Thankfully, technology exists to bring consistency to this
automatically.  clang-format (from llvm) is one example, but it seems to
do the job well enough.

This definition cribs from FreeBSD's style, which isn't too far off the
codebase as it stands at the moment.
@ThomasAdam ThomasAdam changed the title clang-format: use FreeBSD's version clang-format: introduce top-level config file Apr 6, 2024
@ThomasAdam ThomasAdam marked this pull request as ready for review April 6, 2024 22:48
@ThomasAdam ThomasAdam modified the milestones: 1.1.1, 1.1.2 Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Augmenting an existing feature
Projects
Status: PRs
Development

Successfully merging this pull request may close these issues.

1 participant