You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could enforce some agreement on formatting throughout the code using an automatic tool, such as clang-format for C++ and black for Python.
A .clang-format at the root of a project is recognized automatically by most IDEs (VS code, vim, emacs...) . It can also be integrated as a git pre-commit, although this can be a nuisance for a contributor so we could just make it a guideline.
Finally, the clang-format binary can simply be called from the cli.
From working through the OpenMM and OpenMM-torch codebases I have crafted a .clang-format file that leaves most of the current code untouched:
I think that we choose one of the existing formatting styles and adapt it (even if it needs reformating the existing code). For Python, it could be black. For C++, it could be LLVM.
I am all in for adapting an established format. AFAIK when the option BasedOnStyle is not present, like in the above, the LLVM style is selected. So my config is LLVM except for what is present in those options.
Would a big commit reformatting all the code cause conflicts in existing pull requests or interfere with stuff like git blame?
We could enforce some agreement on formatting throughout the code using an automatic tool, such as clang-format for C++ and black for Python.
A .clang-format at the root of a project is recognized automatically by most IDEs (VS code, vim, emacs...) . It can also be integrated as a git pre-commit, although this can be a nuisance for a contributor so we could just make it a guideline.
Finally, the clang-format binary can simply be called from the cli.
From working through the OpenMM and OpenMM-torch codebases I have crafted a .clang-format file that leaves most of the current code untouched:
To give you some examples, these lines:
Turn to this:
While these lines:
are left untouched.
What do you think?
The text was updated successfully, but these errors were encountered: