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

Convert all source files to a unified coding style using clang-format #301

Open
augustofg opened this issue Jan 19, 2024 · 2 comments
Open

Comments

@augustofg
Copy link

The code style is not consistently used, and the lack of proper indentation makes navigation and modification hard and error-prone. I propose using clang-format to convert all source files to an common style, and enforce the new style in the CI.

There are some predefined styles we can choose from (LLVM, GNU, Google, Chromium, Microsoft, Mozilla, WebKit) or it is possible to create a custom .clang-format file.

I can volunteer to implement this proposal if there is enough interest.

@rfuest
Copy link
Collaborator

rfuest commented Jan 19, 2024

The main GTKWave code should already use a consistent coding style and there is also a clang-format configuration file in the repository: https://github.com/gtkwave/gtkwave/blob/master/.clang-format

Which part of the codebase are you referring to?

... and enforce the new style in the CI.

Maybe as a warning, but in my experience the output of clang-format isn't super consistent between versions and I wouldn't want CI to become flaky because of this.

@augustofg
Copy link
Author

Sorry, I was looking at an older version of gtkwave, didn't noticed that it was already reformated. As for running clang-format in the CI, a warning would be enough in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants