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

Consider auto-formatting the source code #191

Open
stvdwtt opened this issue Jun 2, 2023 · 3 comments
Open

Consider auto-formatting the source code #191

stvdwtt opened this issue Jun 2, 2023 · 3 comments

Comments

@stvdwtt
Copy link
Member

stvdwtt commented Jun 2, 2023

The clang compiler has a standalone tool called "clang-format" that automatically formats C++ code according to user-specified options. The benefit is that this ensures consistency across a code base and eliminates the need for developers to think about formats. I've used this in a few different projects, and it works really well. Some code editors can automatically format code on save (e.g. VS Code, Atom) or it can be applied manually.

Here's some info on how to use it:
https://www.clangpowertools.com/blog/getting-started-with-clang-format-style-options.html

To do this, the best way is to add a ".clangf-ormat" file in the root directory of the repository. An example of one is here:
https://github.com/adamantine-sim/adamantine/blob/master/.clang-format

@david-montiel-t what do you think of moving PRISMS-PF to this? If you want, I'd be happy to make a style file and do the initial reformat of all of the files.

@david-montiel-t
Copy link
Contributor

Thank you, Steve

I think it is a good idea. This would only change the style of the code files, right?

Yes, feel free to add the .clang-format file and reformat the code files accordingly.

@stvdwtt
Copy link
Member Author

stvdwtt commented Jun 2, 2023

Sounds good. Do you want me to create a pull request into "master", or do you have a development branch for the next release?

@david-montiel-t
Copy link
Contributor

You can do a PR into master.

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

No branches or pull requests

2 participants