mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
Move doxygen processing logic from unify_includes to doxygen_space
This commit is contained in:
parent
cd60bb8f2d
commit
a540dceae2
@ -38,7 +38,33 @@ def process_file(file_path):
|
||||
|
||||
if re.match(r'^\s*(?:#ifdef|#ifndef|#else|#endif)', line):
|
||||
output.append(line)
|
||||
elif match := re.match(r'^(\s*)//!\s*(.*?)$', line):
|
||||
i += 1
|
||||
continue
|
||||
|
||||
if match := re.match(r'^(\s*)/\*[*!]\s*([^\s*].*)\s*$', line):
|
||||
# Convert blocks starting with /*! format to /** standard,
|
||||
# and convert
|
||||
# /**Some docs
|
||||
# to
|
||||
# /**
|
||||
# * Some docs
|
||||
indent, content = match.groups()
|
||||
output.append(f'{indent}/**')
|
||||
line = f'{indent} * {content[0].upper()}{content[1:]}'
|
||||
|
||||
if match := re.match(r'^(.*)/\*[!*](?!\*)(<*)[ \t\r\n\f]*(.*?)[ \t\r\n\f]*\*/[ \t\r\n\f]*$', line):
|
||||
# Convert single line doxygen blocks:
|
||||
# /*!< comment */ to //!< comment
|
||||
# /** comment */ to //! comment
|
||||
prefix, tag, content = match.groups()
|
||||
line = f'{prefix}//!{tag} {content}'
|
||||
|
||||
if match := re.match(r'^(.*)//!<\s*(.)(.*)$', line):
|
||||
# Uppercase initial character in //!< comment
|
||||
prefix, first, remaining = match.groups()
|
||||
line = f'{prefix}//!< {first.upper()}{remaining}'
|
||||
|
||||
if match := re.match(r'^(\s*)//!\s*(.*?)$', line):
|
||||
indentation, comment = match.groups()
|
||||
# found a //! comment
|
||||
# check next line to see if it also begins with //!
|
||||
|
@ -25,17 +25,6 @@ our @inc;
|
||||
|
||||
END { die "header files not empty" if @inc; }
|
||||
|
||||
# Also fix doxygen comments
|
||||
s#^(\s*)/\*[*!]\s*([^\s*].*)\s*$#$1/** \u$2\n#;
|
||||
|
||||
# Convert single line doxygen blocks:
|
||||
# /*!< comment */ to //!< comment
|
||||
# /** comment */ to //! comment
|
||||
s#\/\*[!\*](?!\*)(<*)\h*(.*?)\h*\*\/\h*$#//!$1 $2#;
|
||||
|
||||
# Uppercase initial character in //!< comment
|
||||
s#\/\/!<\s*(.)(.*)#//!< \u$1$2#;
|
||||
|
||||
# Ensure that pointer members are always initialized to nullptr
|
||||
# We don't run this check by default, there's a high likelihood of false positives...
|
||||
# s#^(\s*(?!typedef|return|delete)(?:\s*(?:const)\s*)?[a-zA-Z0-9_:]+\s*\*+\s*[a-zA-Z0-9_]+)\s*;\s*$#$1 = nullptr;\n#;
|
||||
|
Loading…
x
Reference in New Issue
Block a user