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

Astyle to clang format #8464

Merged
merged 2 commits into from
Mar 3, 2022
Merged

Astyle to clang format #8464

merged 2 commits into from
Mar 3, 2022

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Jan 25, 2022

replaces / amends #8455

  • temporary .clang-format replaced with a -style arg with yaml -> yaml conversion replacing 'blocks' with 'flow' (i.e. removing indentation and wrapping things instead, { for objects, [ for lists)
  • clean-up restyle.sh to use git for relpath, verbose mode to match what astyle & bash echo did. plus, shows the actual command with an additional '-x' option

there does not seem to be an option for one-line brace addition for if() { ... } while() { ... } etc. :/
clang-tidy might help with that, but it needs a build command line info via compile_commands.json so it can handle macros, build options, know the language context etc. For target build of the Core, arduino-cli or platformio can already do that, but need some kind of project file and there might be problems with dependencies not being picked up. Host files need something else, either manually create the .json or use some makefile generator like cmake to build mock files and retrieve build cmd that way.

@mcspr
Copy link
Collaborator Author

mcspr commented Feb 17, 2022

would a different author help filtering when blame / log-search is happening?
order or PRs wouldn't really matter, I guess, might commit this first in the queue

@d-a-v
Copy link
Collaborator

d-a-v commented Feb 17, 2022

Indeed FWIW and given the huge umber of changes, in the past and in my previous attempt I used the separate "allman" account in order to get a better commit history.

@igrr
Copy link
Member

igrr commented Feb 18, 2022

Here's a relevant issue to watch: community/community#5033
Unfortunately there is no indication yet whether/when it might happen.

Ignore mass-reformatting commits
Include the clang-format, and the previous astyle

Based on the idea from black
https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html#avoiding-ruining-git-blame

To be used with git CLI when exploring some specific file history
```
$ git blame --ignore-revs-file .git-blame-ignore-revs -- file.cpp
```

Or, by modifying the config to apply globally
```
$ git config blame.ignoreRevsFile .git-blame-ignore-revs
```
(note that the by default config will apply only for the current repository)
@mcspr mcspr merged commit 24c4152 into esp8266:master Mar 3, 2022
mcspr added a commit that referenced this pull request Mar 3, 2022
mcspr added a commit to mcspr/esp8266-Arduino that referenced this pull request Mar 30, 2022
GitHub PR rebase-merge of esp8266#8464 introduced a new commit, instead of using
the one from the PR tree. Point to that new one in the `master` branch.
(fixing 24c4152 changes)
mcspr added a commit that referenced this pull request Mar 31, 2022
GitHub PR rebase-merge of #8464 introduced a new commit, instead of using
the one from the PR tree. Point to that new one in the `master` branch.
(fixing 24c4152 changes)
@mcspr mcspr added this to the 3.1 milestone Mar 31, 2022
@mcspr mcspr deleted the astyle-to-clang-format branch January 7, 2023 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants