summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-04-16 13:09:17 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-04-19 12:35:03 +0300
commit7d79e9425e258413a523cc2fd124a6ec16839d2a (patch)
tree29cf3b18bbd8b17ea8bd3a6b6849c2443ea41539 /utils
parentfef732d4dc7fcb012c4339585d621d6c6bf384aa (diff)
utils: checkstyle.py: Drop period at end of Doxygen one liners
The libcamera documentation style calls for no period at the end of the Doxygen one-liner commands (\brief, \param and \return). Extend the DoxygenFormatter class to drop the period. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/checkstyle.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 2ab7e50f..88078a61 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -753,6 +753,7 @@ class CLangFormatter(Formatter):
class DoxygenFormatter(Formatter):
patterns = ('*.c', '*.cpp')
+ oneliner_regex = re.compile(r'^ +\* +\\(brief|param|return)\b.*\.$')
return_regex = re.compile(r' +\* +\\return +[a-z]')
@classmethod
@@ -768,6 +769,7 @@ class DoxygenFormatter(Formatter):
lines.append(line)
continue
+ line = cls.oneliner_regex.sub(lambda m: m.group(0)[:-1], line)
line = cls.return_regex.sub(lambda m: m.group(0)[:-1] + m.group(0)[-1].upper(), line)
if line.find('*/') != -1: