Functions | |
| Tuple[str, bool, List[str]] | check_formatting_file (str filename, bool fix, bool verbose, str clang_format_path) |
| CHECK STYLE FUNCTIONS. | |
| Tuple[bool, str, List[str]] | check_include_prefixes_line (str line, str filename, int line_number) |
| Tuple[str, bool, List[str]] | check_manually_file (str filename, bool fix, bool verbose, bool respect_clang_format_guards, Callable[[str, str, int], Tuple[bool, str, List[str]]] check_style_line_function) |
| bool | check_style_clang_format (List[str] paths, bool enable_check_include_prefixes, bool enable_check_formatting, bool enable_check_whitespace, bool enable_check_tabs, bool fix, bool verbose, int n_jobs=1) |
| CHECK STYLE MAIN FUNCTIONS. | |
| bool | check_style_files (str style_check_str, Callable[..., Tuple[str, bool, List[str]]] check_style_file_function, List[str] filenames, bool fix, bool verbose, int n_jobs, **kwargs) |
| Tuple[bool, str, List[str]] | check_tabs_line (str line, str filename, int line_number) |
| Tuple[bool, str, List[str]] | check_whitespace_line (str line, str filename, int line_number) |
| str | find_clang_format_path () |
| Tuple[List[str], List[str], List[str], List[str]] | find_files_to_check_style (List[str] paths) |
| bool | should_analyze_directory (str dirpath) |
| AUXILIARY FUNCTIONS. | |
| bool | should_analyze_file (str path, List[str] files_to_check, List[str] file_extensions_to_check) |
Variables | |
| action | |
| bool | all_checks_successful |
| argparse | args = parser.parse_args() |
| str | CLANG_FORMAT_GUARD_OFF = "// clang-format off" |
| str | CLANG_FORMAT_GUARD_ON = "// clang-format on" |
| list | CLANG_FORMAT_VERSIONS |
| PARAMETERS. | |
| default | |
| list | DIRECTORIES_TO_SKIP |
| else : | |
| list | FILE_EXTENSIONS_TO_CHECK_FORMATTING |
| list | FILE_EXTENSIONS_TO_CHECK_INCLUDE_PREFIXES = FILE_EXTENSIONS_TO_CHECK_FORMATTING |
| list | FILE_EXTENSIONS_TO_CHECK_TABS |
| list | FILE_EXTENSIONS_TO_CHECK_WHITESPACE |
| list | FILES_TO_CHECK_WHITESPACE |
| list | FILES_TO_SKIP |
| help | |
| nargs | |
| argparse | parser |
| MAIN. | |
| int | TAB_SIZE = 4 |
| try : | |
| type | |
| Tuple[str, bool, List[str]] check-style-clang-format.check_formatting_file | ( | str | filename, |
| bool | fix, | ||
| bool | verbose, | ||
| str | clang_format_path | ||
| ) |
CHECK STYLE FUNCTIONS.
Check / fix the coding style of a file with clang-format.
@param filename Name of the file to be checked.
@param fix Whether to fix (True) or just check (False) the style of the file (True).
@param verbose Show the lines that are not compliant with the style.
@param clang_format_path Path to clang-format.
@return Tuple [Filename,
Whether the file is compliant with the style (before the check),
Verbose information].
Definition at line 443 of file check-style-clang-format.py.
| Tuple[bool, str, List[str]] check-style-clang-format.check_include_prefixes_line | ( | str | line, |
| str | filename, | ||
| int | line_number | ||
| ) |
Check / fix #include headers from the same module with the "ns3/" prefix in a line.
@param line The line to check.
@param filename Name of the file to be checked.
@param line_number The number of the line checked.
@return Tuple [Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information].
Definition at line 566 of file check-style-clang-format.py.
| Tuple[str, bool, List[str]] check-style-clang-format.check_manually_file | ( | str | filename, |
| bool | fix, | ||
| bool | verbose, | ||
| bool | respect_clang_format_guards, | ||
| Callable[[str, str, int], Tuple[bool, str, List[str]]] | check_style_line_function | ||
| ) |
Check / fix a file manually using a function to check / fix each line.
@param filename Name of the file to be checked.
@param fix Whether to fix (True) or just check (False) the style of the file (True).
@param verbose Show the lines that are not compliant with the style.
@param respect_clang_format_guards Whether to respect clang-format guards.
@param check_style_line_function Function used to check each line.
@return Tuple [Filename,
Whether the file is compliant with the style (before the check),
Verbose information].
Definition at line 501 of file check-style-clang-format.py.
| bool check-style-clang-format.check_style_clang_format | ( | List[str] | paths, |
| bool | enable_check_include_prefixes, | ||
| bool | enable_check_formatting, | ||
| bool | enable_check_whitespace, | ||
| bool | enable_check_tabs, | ||
| bool | fix, | ||
| bool | verbose, | ||
| int | n_jobs = 1 |
||
| ) |
CHECK STYLE MAIN FUNCTIONS.
Check / fix the coding style of a list of files. @param paths List of paths to the files to check. @param enable_check_include_prefixes Whether to enable checking #include headers from the same module with the "ns3/" prefix. @param enable_check_formatting Whether to enable checking code formatting. @param enable_check_whitespace Whether to enable checking trailing whitespace. @param enable_check_tabs Whether to enable checking tabs. @param fix Whether to fix (True) or just check (False) the file. @param verbose Show the lines that are not compliant with the style. @param n_jobs Number of parallel jobs. @return Whether all files are compliant with all enabled style checks.
Definition at line 276 of file check-style-clang-format.py.
References check_style_files(), find_clang_format_path(), and find_files_to_check_style().
Here is the call graph for this function:| bool check-style-clang-format.check_style_files | ( | str | style_check_str, |
| Callable[..., Tuple[str, bool, List[str]]] | check_style_file_function, | ||
| List[str] | filenames, | ||
| bool | fix, | ||
| bool | verbose, | ||
| int | n_jobs, | ||
| ** | kwargs | ||
| ) |
Check / fix style of a list of files. @param style_check_str Description of the check to be performed. @param check_style_file_function Function used to check the file. @param filename Name of the file to be checked. @param fix Whether to fix (True) or just check (False) the file (True). @param verbose Show the lines that are not compliant with the style. @param n_jobs Number of parallel jobs. @param kwargs Additional keyword arguments to the check_style_file_function. @return Whether all files are compliant with the style.
Definition at line 375 of file check-style-clang-format.py.
Referenced by check_style_clang_format().
Here is the caller graph for this function:| Tuple[bool, str, List[str]] check-style-clang-format.check_tabs_line | ( | str | line, |
| str | filename, | ||
| int | line_number | ||
| ) |
Check / fix tabs in a line.
@param line The line to check.
@param filename Name of the file to be checked.
@param line_number The number of the line checked.
@return Tuple [Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information].
Definition at line 650 of file check-style-clang-format.py.
| Tuple[bool, str, List[str]] check-style-clang-format.check_whitespace_line | ( | str | line, |
| str | filename, | ||
| int | line_number | ||
| ) |
Check / fix whitespace in a line.
@param line The line to check.
@param filename Name of the file to be checked.
@param line_number The number of the line checked.
@return Tuple [Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information].
Definition at line 617 of file check-style-clang-format.py.
| str check-style-clang-format.find_clang_format_path | ( | ) |
Find the path to one of the supported versions of clang-format. If no supported version of clang-format is found, raise an exception. @return Path to clang-format.
Definition at line 234 of file check-style-clang-format.py.
Referenced by check_style_clang_format().
Here is the caller graph for this function:| Tuple[List[str], List[str], List[str], List[str]] check-style-clang-format.find_files_to_check_style | ( | List[str] | paths | ) |
Find all files to be checked in a given list of paths.
@param paths List of paths to the files to check.
@return Tuple [List of files to check include prefixes,
List of files to check formatting,
List of files to check trailing whitespace,
List of files to check tabs].
Definition at line 173 of file check-style-clang-format.py.
References should_analyze_directory(), and should_analyze_file().
Referenced by check_style_clang_format().
Here is the call graph for this function:
Here is the caller graph for this function:| bool check-style-clang-format.should_analyze_directory | ( | str | dirpath | ) |
AUXILIARY FUNCTIONS.
Check whether a directory should be analyzed. @param dirpath Directory path. @return Whether the directory should be analyzed.
Definition at line 134 of file check-style-clang-format.py.
Referenced by find_files_to_check_style().
Here is the caller graph for this function:| bool check-style-clang-format.should_analyze_file | ( | str | path, |
| List[str] | files_to_check, | ||
| List[str] | file_extensions_to_check | ||
| ) |
Check whether a file should be analyzed. @param path Path to the file. @param files_to_check List of files that shall be checked. @param file_extensions_to_check List of file extensions that shall be checked. @return Whether the file should be analyzed.
Definition at line 149 of file check-style-clang-format.py.
Referenced by find_files_to_check_style().
Here is the caller graph for this function:| check-style-clang-format.action |
Definition at line 703 of file check-style-clang-format.py.
| bool check-style-clang-format.all_checks_successful |
Definition at line 757 of file check-style-clang-format.py.
| argparse check-style-clang-format.args = parser.parse_args() |
Definition at line 754 of file check-style-clang-format.py.
| str check-style-clang-format.CLANG_FORMAT_GUARD_OFF = "// clang-format off" |
Definition at line 58 of file check-style-clang-format.py.
| str check-style-clang-format.CLANG_FORMAT_GUARD_ON = "// clang-format on" |
Definition at line 57 of file check-style-clang-format.py.
| list check-style-clang-format.CLANG_FORMAT_VERSIONS |
PARAMETERS.
Definition at line 50 of file check-style-clang-format.py.
| check-style-clang-format.default |
Definition at line 750 of file check-style-clang-format.py.
| list check-style-clang-format.DIRECTORIES_TO_SKIP |
Definition at line 60 of file check-style-clang-format.py.
| check-style-clang-format.else : |
Definition at line 774 of file check-style-clang-format.py.
| list check-style-clang-format.FILE_EXTENSIONS_TO_CHECK_FORMATTING |
Definition at line 75 of file check-style-clang-format.py.
| list check-style-clang-format.FILE_EXTENSIONS_TO_CHECK_INCLUDE_PREFIXES = FILE_EXTENSIONS_TO_CHECK_FORMATTING |
Definition at line 81 of file check-style-clang-format.py.
| list check-style-clang-format.FILE_EXTENSIONS_TO_CHECK_TABS |
Definition at line 118 of file check-style-clang-format.py.
| list check-style-clang-format.FILE_EXTENSIONS_TO_CHECK_WHITESPACE |
Definition at line 83 of file check-style-clang-format.py.
| list check-style-clang-format.FILES_TO_CHECK_WHITESPACE |
Definition at line 113 of file check-style-clang-format.py.
| list check-style-clang-format.FILES_TO_SKIP |
Definition at line 71 of file check-style-clang-format.py.
| check-style-clang-format.help |
Definition at line 706 of file check-style-clang-format.py.
| check-style-clang-format.nargs |
Definition at line 705 of file check-style-clang-format.py.
| argparse check-style-clang-format.parser |
MAIN.
Definition at line 689 of file check-style-clang-format.py.
| int check-style-clang-format.TAB_SIZE = 4 |
Definition at line 128 of file check-style-clang-format.py.
| check-style-clang-format.try : |
Definition at line 756 of file check-style-clang-format.py.
| check-style-clang-format.type |
Definition at line 704 of file check-style-clang-format.py.