(retitled from Looking for feedback on add_new_check.py functionality)
This is really a first revision to get some feedback from code owners about where a change like this should be added (if at all)
Recently while submitting a patch D55433: [clang-tidy] Adding a new modernize use nodiscard checker and looking at other similar reviews D48866: [clang-tidy] Add incorrect-pointer-cast checker,D54222: [clang-tidy] Add a check to detect returning static locals in public headers , I noticed a number of times my review was commented on with "Please use 80 characters limit." in .rst files.
as clang-format doesn't automatically correct these files its really easy for these comments to creep back in in subsequent revisions, potentially resulting in more comments and more revisions.
We could add validation of the .rst files as a step that could be performed prior to submitting a patch to help get reviews ready, this would reduce the repetition that key reviewers have to perform for each new person who ventures to submit something.
We could either put such a validation step directly into add_new_check.py
e.g. add_new_check.py -validate checker_module checker_name
or as a new python file (which is what I include here mainly for brevity)
validate_check.py checker_module checker_name
This would then validate the line length of .rst files, and determine if the line could be filled to closer to 80 characters by including the first word from next line
Included in this patch, are the changes found by running this with
validate_check.py modernize-use-noexcept
It checks both docs/ReleaseNotes.rst and the specified checker in docs/clang-tidy/checks/module_name-checker_name.rst
and emits outputs like....
e.g.
Checking ..\docs\clang-tidy\checks\modernize-use-noexcept.rst... Line 32 maximize 80 characters by joining:'[Users can use :option:`ReplacementString` to specify a macro to use ]' and '[instead] Line 33 maximize 80 characters by joining:'[instead of ``noexcept``. This is useful when maintaining source code ]' and '[that]
Please align the string better.