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

Start using Formatting Tools #38

Closed
ibaned opened this issue Jan 30, 2017 · 4 comments
Closed

Start using Formatting Tools #38

ibaned opened this issue Jan 30, 2017 · 4 comments

Comments

@ibaned
Copy link
Contributor

ibaned commented Jan 30, 2017

I've created a Wiki page here:

https://github.com/gahansen/Albany/wiki/Formatting-Tools

Which describes clang-format, a tool to automatically format C++ files, and xmllint, a tool which automatically formats XML files.

Based on discussion in the weekly phone call, possible uses of these tools include:

  • Albany developers as a team agree on one or more clang-format styles that accurately match our own style(s)
    • certain packages such as LCM may want a different style, this could be supported with a file src/LCM/.clang-format
  • when you substantially modify a C++ file, consider using clang-format to also clean up the styling of it
  • when you substantially modify an XML file, consider using xmllint to clean up its indentation
  • we may want to go through the codebase and apply clang-format to most of the source
  • likewise we could apply xmllint to most of the input.xml files

As always, this issue is here to gather feedback on this. We may start to iterate on a .clang-format file in the near future.

@ibaned
Copy link
Contributor Author

ibaned commented Jan 30, 2017

@agsalin @gahansen @ikalash

@ibaned
Copy link
Contributor Author

ibaned commented Jan 30, 2017

@bgranzow

@lxmota
Copy link
Contributor

lxmota commented Feb 1, 2017

For LCM we try to follow the Google C++ coding standards. For formatting, I use Eclipse with the BSD-Allman style of formatting. I'll check clang-format to see what it does.

@ibaned
Copy link
Contributor Author

ibaned commented Feb 2, 2017

Google is one of its styles, and is the one I base my format on. One thing that might be of use is to choose a representative C++ file and we can look at it under different settings.

lxmota added a commit that referenced this issue Mar 15, 2017
lxmota added a commit that referenced this issue Mar 15, 2017
following the Google C++ style guide:

https://google.github.io/styleguide/cppguide.html

The configuration has some minor deviations that deal with white space.

(#22, #38)
lxmota added a commit that referenced this issue Mar 16, 2017
Remove unneeded member functions. Use clang-format as we touch other
source files.

[#22, #38, #53]
lxmota added a commit that referenced this issue Mar 16, 2017
apparently not useful because Albany::ModelEvaluator complains
regarldess that solution is null. [#53]

Run through clang-format and add \dotdot{x} support now that
it exists in Thyra. [#22, #38]
lxmota added a commit that referenced this issue Mar 25, 2017
lxmota added a commit that referenced this issue Apr 27, 2017
lxmota added a commit that referenced this issue Nov 15, 2017
reveaed while using clang-format. [#38]
lxmota added a commit that referenced this issue Mar 8, 2018
lxmota added a commit that referenced this issue Mar 15, 2018
lxmota added a commit that referenced this issue Aug 14, 2018
Use clang-format to format almost all the code under the LCM
subdirectory. This uncovered some inconsistencies with #include
statements that were fixed.

The main exception to this reformatting is the crystal plasticity
model. Jay Foulk, Coleman Alleman, Guy Bergel, and Dave Littlewood
would gang up and kill me if I touch that code in this manner.
@ikalash ikalash closed this as completed Jul 7, 2020
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

3 participants