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

make use of clang-format or uncrustify #395

Open
3 tasks
bk138 opened this issue Apr 11, 2020 · 4 comments
Open
3 tasks

make use of clang-format or uncrustify #395

bk138 opened this issue Apr 11, 2020 · 4 comments

Comments

@bk138
Copy link
Member

bk138 commented Apr 11, 2020

  • add style spec

  • format all code

  • enforce in CI

@bk138 bk138 added this to the Release 0.9.14 milestone Apr 11, 2020
@bk138
Copy link
Member Author

bk138 commented Feb 5, 2021

editorconfig is not really up to the task as

  • most plugins only understand encoding, tabs vs spaces and indent width, nothing about brace style for instance
  • editorconfig linting support for C is abysmal, seems eclint and ec are targeted at JS and the likes

@bk138
Copy link
Member Author

bk138 commented Feb 5, 2021

clang-format could step in

BreakBeforeBraces: Linux
IndentWidth: '4'

@bk138 bk138 changed the title make use of editorconfig make use of clang-format Feb 5, 2021
@antenore
Copy link
Contributor

May I suggest to use uncrustify instead?

The big advantage is that the configuration is much simple, and it has an example following the K&R style by default https://github.com/uncrustify/uncrustify/blob/master/etc/kr-indent.cfg, that file can be easily modified for the bracket and space customization.

Uncrustify works quite well, it's actively maintained and can be easily integrated in many editors, IDE and build systems.

If you give me the GO I can try to submit a PR.

@bk138
Copy link
Member Author

bk138 commented Apr 27, 2022

Sounds promising, but all kinds of formatting changes are probably held up by open PRs and #394 - after those, this can be tackled, me thinks

@bk138 bk138 changed the title make use of clang-format make use of clang-format or uncrustify Apr 27, 2022
bk138 added a commit that referenced this issue Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants