Conversation
aheejin
approved these changes
Apr 26, 2019
Member
aheejin
left a comment
There was a problem hiding this comment.
Yay! Thank you for doing this.
This was referenced Apr 27, 2019
aheejin
added a commit
to aheejin/wabt
that referenced
this pull request
Jun 27, 2021
This applies clang-format to the whole codebase. I noticed we have .clang-format in wabt but the codebase is not very well formatted. This kind of mass-formatting PR has fans and skeptics because it can mess with `git blame`, but we did a similar thing in Binaryen a few years ago (WebAssembly/binaryen#2048, which was merged in WebAssembly/binaryen#2059) and it was not very confusing after all. If we are going to ever format the codebase, I think it is easier to do it in a single big PR than dozens of smaller PRs. This does not include files in src/prebuilt, because they are generated. This PR is mainly to listen to opinions and it is OK we end up not merging this.
aheejin
added a commit
to aheejin/wabt
that referenced
this pull request
Jun 27, 2021
This applies clang-format to the whole codebase. I noticed we have .clang-format in wabt but the codebase is not very well formatted. This kind of mass-formatting PR has fans and skeptics because it can mess with `git blame`, but we did a similar thing in Binaryen a few years ago (WebAssembly/binaryen#2048, which was merged in WebAssembly/binaryen#2059) and it was not very confusing after all. If we are going to ever format the codebase, I think it is easier to do it in a single big PR than dozens of smaller PRs. This does not include files in src/prebuilt, because they are generated. This PR is mainly to listen to opinions and it is OK we end up not merging this. (Also even if we end up merging this, I'm not sure if I am the right person to change this many lines of code, given that I am not a frequent contributor in this repo.)
aheejin
added a commit
to aheejin/wabt
that referenced
this pull request
Jun 27, 2021
This applies clang-format to the whole codebase. I noticed we have .clang-format in wabt but the codebase is not very well formatted. This kind of mass-formatting PR has fans and skeptics because it can mess with `git blame`, but we did a similar thing in Binaryen a few years ago (WebAssembly/binaryen#2048, which was merged in WebAssembly/binaryen#2059) and it was not very confusing after all. If we are going to ever format the codebase, I think it is easier to do it in a single big PR than dozens of smaller PRs. This does not include files in src/prebuilt, because they are generated. This PR is mainly to listen to opinions and it is OK we end up not merging this. (Also even if we end up merging this, I'm not sure if I am the right person to change this many lines of code, given that I am not a frequent contributor in this repo.) I also added a clang-format check hook in the Github CI in WebAssembly#1683, which I think can be less controversial, given that it only checks the diff.
aheejin
added a commit
to aheejin/wabt
that referenced
this pull request
Jun 27, 2021
This applies clang-format to the whole codebase. I noticed we have .clang-format in wabt but the codebase is not very well formatted. This kind of mass-formatting PR has fans and skeptics because it can mess with `git blame`, but we did a similar thing in Binaryen a few years ago (WebAssembly/binaryen#2048, which was merged in WebAssembly/binaryen#2059) and it was not very confusing after all. If we are going to ever format the codebase, I think it is easier to do it in a single big PR than dozens of smaller PRs. This is using the existing .clang-format file in this repo, which follows the style of Chromium. If we think this does not suit the current formatting style, we can potentially tweak .clang-format too. For example, I noticed the current codebase puts many `case` statements within a single line when they are short, but the current .clang-format does not allow that. This does not include files in src/prebuilt, because they are generated. This also manually fixes some comment lines, because mechanically applying clang-format to long inline comments can look weird. This PR is mainly to listen to opinions and it is OK we end up not merging this. (Also even if we end up merging this, I'm not sure if I am the right person to change this many lines of code, given that I am not a frequent contributor in this repo.) I also added a clang-format check hook in the Github CI in WebAssembly#1683, which I think can be less controversial, given that it only checks the diff.
aheejin
added a commit
to WebAssembly/wabt
that referenced
this pull request
Dec 21, 2021
This applies clang-format to the whole codebase. I noticed we have .clang-format in wabt but the codebase is not very well formatted. This kind of mass-formatting PR has fans and skeptics because it can mess with `git blame`, but we did a similar thing in Binaryen a few years ago (WebAssembly/binaryen#2048, which was merged in WebAssembly/binaryen#2059) and it was not very confusing after all. If we are ever going to format the codebase, I think it is easier to do it in a single big PR than dozens of smaller PRs. This is using the existing .clang-format file in this repo, which follows the style of Chromium. If we think this does not suit the current formatting style, we can potentially tweak .clang-format too. For example, I noticed the current codebase puts many `case` statements within a single line when they are short, but the current .clang-format does not allow that. This does not include files in src/prebuilt, because they are generated. This also manually fixes some comment lines, because mechanically applying clang-format to long inline comments can look weird. I also added a clang-format check hook in the Github CI in #1683, which I think can be less controversial, given that it only checks the diff. --- After discussions, we ended up reverting many changes, especially one-liner functions and switch-cases, which are too many to wrap in `// clang-format off` and `// clang-format on`. I also considered fixing `.clang-format` to allow those one-liners but it caused a larger churn in other parts. So currently the codebase does not conform to `.clang-format` 100%, but we decided it's fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048