Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR applies the PRM formatter prmindent to almost all PRM files in deal.II. Assuming prmindent is available in PATH, you can reproduce the results by running the following in the root directory of deal.II:
(If you have mawk or gawk installed, installing prmindent should be just a question of making the script executable and placing it somewhere in your PATH. Or you could also read its installation instructions.)
This PR is a follow-up to @bangerth's suggestion on the mailing list. To summarize the situation: I wrote prmindent for use in Lethe some time ago, and @bangerth said it could be added to deal.II's contrib/utilities. This PR is an opportunity to discuss prmindent's formatting (and eventually to format deal.II's PRM files). If it is accepted, I will submit another PR adding prmindent to contrib/utilities.
On the whole, I am quite happy with the changes, which are few. However, there are some issues, which I will discuss presently.
The main difference with the current PRM style in deal.II is that values are aligned only if not separated by blank lines or comments. This style is not scrupulously followed throughout deal.II, so I do not foresee it being an issue. Also, top-level blocks, i.e., subsections or groups of entries, are separated by a blank line.
One discrepant formatting style currently applied by prmindent is the addition of blank lines between comments and top-level subsections or entries (this is actually an artifact of separating top-level blocks). Another is that prmindent currently adds a trailing space for entries with no value. I will fix these.
Finally, some of the pathological ParameterHandler test cases in tests/parameter_handler are handled somewhat poorly, specifically those involving backslashes. I have not applied prmindent to the ParameterHandler test files, as they have presumably been carefully crafted.
Also, I do not know if multiline multiple parameter loops are common, but prmindent treats them only as ordinary values, so it will not align them in any way.
Feel free to comment on prmindent's style and make any requests. The time for bikeshedding is now.