prmindent — Indent and format PRM files

51 views
Skip to first unread message

Paul A. Patience

unread,
Aug 10, 2023, 7:18:48 PM8/10/23
to dea...@googlegroups.com
Hello everyone,

Last year I wrote a script to indent PRM files [1] in the Lethe project [2]. You may find it useful.

It can be used to recursively indent all PRM files in place in the current directory using find [3].

Best regards,
Paul

[1]: https://git.sr.ht/~paulapatience/prmindent
[2]: https://github.com/lethe-cfd/lethe/blob/master/contrib/utilities/prmindent
[3]: https://github.com/lethe-cfd/lethe/blob/241d2222ad817bfc1fe8d58433f3cd1b098220d2/contrib/utilities/pre-commit.sh#L10

blais...@gmail.com

unread,
Aug 11, 2023, 7:43:58 AM8/11/23
to deal.II User Group
+1 Paul, god is this script fun

Wolfgang Bangerth

unread,
Aug 17, 2023, 6:43:32 PM8/17/23
to dea...@googlegroups.com

Hi Paul,

> Last year I wrote a script to indent PRM files [1] in the Lethe project [2].
> You may find it useful.
>
> It can be used to recursively indent all PRM files in place in the current
> directory using find [3].

Very nice!

Two proposals:
* We could add this script to the contrib/utilities/ directory. It would not
be difficult to have that script installed alongside the library, just like
the one file that is currently listed in contrib/utilities/CMakeLists.txt. If
the script was part of deal.II, we should also augment the documentation of
the ParameterHandler class to point to it.

* There are currently 133 .prm files in the deal.II source tree:
> find . -name *.prm | wc -l
One way to assess how the script works would be to run it on all of these
files and turn this into a pull request in itself.

Best & thanks for offering the script!
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Reply all
Reply to author
Forward
0 new messages