![]() |
|
Functions | |
str | load_file (Path fname) |
str | process_doxygen_formula_block (str text) |
int | find_number_of_leading_whitespaces (str text, int index) |
None | process_file (Path fname, str pattern, bool add_newline, bool in_place=False) |
bool | has_broken_formula (Path fname, str pattern) |
List[Path] | find_all_cpp_files (Path base_dir) |
None | run (str base_dir, bool in_place=False, bool just_list_files=False) |
Variables | |
parser = argparse.ArgumentParser(description='Fixes Doxygen formulae.') | |
type | |
default | |
help | |
action | |
False | |
args = parser.parse_args() | |
base_dir | |
in_place | |
silent | |
list_files | |
stdout | |
just_list_files | |
List[Path] fix_broken_doxygen_formulae.find_all_cpp_files | ( | Path | base_dir | ) |
Finds all the headers and source files in this directory and below. :param base_dir: the path to the directory to search in and below. :type base_dir: str :return: an array of paths to header/source files. :rtype: List[str]
Referenced by run().
Given the index of a position in a text, it finds the corresponding line in the text and the number of leading whitespaces on that line. :param text: a block of text. :type text: str :param index: the index in 'text' to determine the number of leading whitespaces from. :type index: int :return: the number of leading whitespaces. :rtype: int
Referenced by process_file().
bool fix_broken_doxygen_formulae.has_broken_formula | ( | Path | fname, |
str | pattern | ||
) |
Identifies whether the file contains a broken Doxygen formula, i.e. the formula is split over more than one line. :param fname: the absolute path to a file. :type fname: Path :return: True if the file is "broken" and False otherwise. :rtype: bool
References load_file().
Referenced by run().
str fix_broken_doxygen_formulae.load_file | ( | Path | fname | ) |
Reads in the data stored in the input file. :param fname: the path to a file. :type fname: Path :return: the contents of 'fname'. :rtype: str
Referenced by has_broken_formula(), and process_file().
str fix_broken_doxygen_formulae.process_doxygen_formula_block | ( | str | text | ) |
Removes newlines and comments from the passed Doxygen formula block. :param text: a Doxygen formula block, possibly broken over several lines. :type text: str :return: the processed formula text, as a single line of text (no newlines). :rtype: str
Referenced by process_file().
None fix_broken_doxygen_formulae.process_file | ( | Path | fname, |
str | pattern, | ||
bool | add_newline, | ||
bool | in_place = False |
||
) |
Performs regex magic to fix broken Doxygen formulae. :param fname: the path to the file to fix. :type fname: Path :param add_newline: flag indicating whether new lines should be added around the processed text, e.g. inline code might not but a formula block might. :type add_newline: bool :param in_place: [description], defaults to False :type in_place: bool, optional
References find_number_of_leading_whitespaces(), format(), load_file(), Eigen::internal.print(), and process_doxygen_formula_block().
Referenced by run().
None fix_broken_doxygen_formulae.run | ( | str | base_dir, |
bool | in_place = False , |
||
bool | just_list_files = False |
||
) |
Fixes all of the broken Doxygen formulae in the C++ source files of a specific directory. :param base_dir: the directory in and below which to consider. :type base_dir: str :param in_place: edits files in-place, defaults to False :type in_place: bool, optional :param just_list_files: [description], defaults to False :type just_list_files: bool, optional :return: [description] :rtype: [type]
References find_all_cpp_files(), format(), has_broken_formula(), Eigen::internal.print(), and process_file().
fix_broken_doxygen_formulae.action |
fix_broken_doxygen_formulae.args = parser.parse_args() |
fix_broken_doxygen_formulae.base_dir |
fix_broken_doxygen_formulae.default |
fix_broken_doxygen_formulae.False |
fix_broken_doxygen_formulae.help |
fix_broken_doxygen_formulae.in_place |
fix_broken_doxygen_formulae.just_list_files |
fix_broken_doxygen_formulae.list_files |
fix_broken_doxygen_formulae.parser = argparse.ArgumentParser(description='Fixes Doxygen formulae.') |
fix_broken_doxygen_formulae.silent |
fix_broken_doxygen_formulae.stdout |
Referenced by main(), and testing::Benchmark.RunWithArg().
fix_broken_doxygen_formulae.type |