Open mabruzzo opened 4 months ago
I made a few tweaks based on the work I had done while creating similar a similar PR for Enzo-E (in enzo-project/enzo-e#420)
These changes include:
.clang-format
formatting rules to prevent reordering of include-directives (I think it might be nice to re-enable this, but that's a topic for a different day)..pre-commit-config.yaml
file to tool-specific files (.ruff.toml
[^1] and .clang-format-ignore
[^2]). This ensures that the linting tools are aware of the exclusion list, even if you manually invoke the linting tools (outside of pre-commit)[^1]: Once we merge #208, we should move the contents of .ruff.toml
into the [tool.ruff]
section of the pyproject.toml
file that will be introduced.
[^2]: I also needed to bump the clang-format
version used during linting (the previously pinned version didn't know about the .clang-format-ignore
file)
I added a 3.4 milestone to this (but we can change it). My primary motivation for doing this was Britton's idea that we could start more broadly applying formatting after the next release.
Overview
As a followup to #218, This introduced a basic configuration file for the pre-commit software that calls clang-format and ruff run code-formatting on all new c/c++/python files added to grackle. All existing files will not be touched. (with that said, I tested out the new c/c++ linting on
src/clib/utils.c
andsrc/clib/utils.h
since they are unlikely to have merge conflicts).I also added documentation explaining how to locally run this machinery.
We are interested in using pre-commit.ci, which is a continuous integration system designed around pre-commit.
yt
actually makes use of pre-commit.ciWhat we need to do after merging
We will need to go to the pre-commit.ci and enable it for the grackle repository. (I'm happy to try to do that, but I may not have appropriate permissions -- so Britton may ultimately need to do that)