fortran-lang / stdlib

Fortran Standard Library
https://stdlib.fortran-lang.org
MIT License
1.06k stars 164 forks source link

Use autoformatting, enforced by CI #29

Open certik opened 4 years ago

certik commented 4 years ago

@zbeekman wrote:

Best thing I've found so far is findent and eclint for Fortran. findent works off an actual AST and claims to test against all code examples in the latest Modern Fortran Explained by MRC, so it should be robust. Probably won't help with this particular style issue, but I haven't been using it in earnest yet as I just discovered it (and added it to Homebrew).

zbeekman commented 4 years ago

What about local pre-commit hooks too? The pre-commit project is pretty great.

I also think we should get an editorconfig file going asap

certik commented 4 years ago

What happens when people submit a PR without setting up pre commit hooks? For example by directly modifying files at GitHub and submitting the PR online?

zbeekman commented 4 years ago

We can have the PR run the pre-commit hooks during CI too... We could even have running CMake (or at build time) detect a build from git, see if the current author has made any commits and install hooks for them if they have... I'm happy to use it or not use it, but I've found it very helpful personally.

certik commented 4 years ago

Let's setup automatic formatting check on a CI:

Later, let's also:

zbeekman commented 4 years ago

Let's get some of those ready to merge PRs in before I start work on any of this. There are a bunch that are ready to ship. I'd merge them myself because I think everyone is in agreement, but I'm not part of the fortran-lang org.