Indentation in the presence of requires-clauses
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 16h 4m
- Merged PRs (30d)
- 36
Description
We are inconsistent in how we indent subsequent lines when requires-clauses are present. We should update the wiki to include requires-clauses, and fix the indentation where needed.
Recall the established conventions:
-
Class templates do not indent after the template head:
template<class T> struct is_correctly_formatted; -
Function templates are indented after the template head:
template<class T> constexpr size_t indent_for(T&& val);
Now enter requires-clauses. We seem to be pretty consistent in indenting the requires-clause itself. So I propose to mix that in as follows:
-
For class templates, the class key itself is unindented, even though there's intervening indentation for the requires-clause:
template<class T> requires literary_type<T> struct is_correctly_formatted; -
For function templates, the function is indented by one more level:
template<class T> requires literary_type<T> constexpr size_t indent_for(T&& val);
An alternative would be to not add extra indentation to function templates (so everything below the template head would just be indented by one level), but we generally seem to like increasing indentation depth for function templates.
Thoughts?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the existing wiki indentation conventions and the draft's examples involving requires-clauses. Compare class and function template formatting with the conventions described here, then update the wiki and correct inconsistent indentation. Done means the documented rules and affected draft formatting agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tex
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100