Functions | |
| Tuple[bool, str, List[str]] | check_doxygen_tags_line (str line, str filename, int line_number) |
| Tuple[bool, str, List[str]] | check_emacs_line (str line, str filename, int line_number) |
| Tuple[str, bool, List[str]] | check_encoding_file (str filename, bool fix, bool verbose) |
| 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[bool, str, List[str]] | check_include_quotes_line (str line, str filename, int line_number) |
| Tuple[bool, str, List[str]] | check_licenses_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, Dict[str, bool] checks_enabled, 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 () |
| Dict[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 |
| args = parser.parse_args() | |
| list | CHECKS |
| int | CLANG_FORMAT_MAX_VERSION = 20 |
| PARAMETERS. | |
| int | CLANG_FORMAT_MIN_VERSION = 20 |
| default | |
| list | DIRECTORIES_TO_SKIP |
| str | FILE_ENCODING = "UTF-8" |
| dict | FILE_EXTENSIONS_TO_CHECK = {c: [] for c in CHECKS} |
| dict | FILES_TO_CHECK = {c: [] for c in CHECKS} |
| list | FILES_TO_SKIP |
| list | FORMAT_GUARD_OFF |
| list | FORMAT_GUARD_ON |
| help | |
| nargs | |
| parser | |
| sep | |
| int | TAB_SIZE = 4 |
| type | |
| Tuple[bool, str, List[str]] check-style-clang-format.check_doxygen_tags_line | ( | str | line, |
| str | filename, | ||
| int | line_number ) |
Check / fix Doxygen tags using \\ rather than @ in a line.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information)
Definition at line 793 of file check-style-clang-format.py.
| Tuple[bool, str, List[str]] check-style-clang-format.check_emacs_line | ( | str | line, |
| str | filename, | ||
| int | line_number ) |
Check / fix emacs file style comment in a line.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information)
Definition at line 913 of file check-style-clang-format.py.
| Tuple[str, bool, List[str]] check-style-clang-format.check_encoding_file | ( | str | filename, |
| bool | fix, | ||
| bool | verbose ) |
Check / fix the encoding of a file.
Args:
filename: Name of the file to be checked.
fix: Whether to fix (True) or just check (False) the encoding of the file.
verbose: Show the lines that are not compliant with the style.
Returns:
Tuple (Filename,
Whether the file is compliant with the style (before the check),
Verbose information)
Definition at line 571 of file check-style-clang-format.py.
| 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.
Args:
filename: Name of the file to be checked.
fix: Whether to fix (True) or just check (False) the style of the file.
verbose: Show the lines that are not compliant with the style.
clang_format_path: Path to clang-format.
Returns:
Tuple (Filename,
Whether the file is compliant with the style (before the check),
Verbose information)
Definition at line 511 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.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Filename,
Whether the line is compliant with the style (before the check),
Verbose information)
Definition at line 700 of file check-style-clang-format.py.
| Tuple[bool, str, List[str]] check-style-clang-format.check_include_quotes_line | ( | str | line, |
| str | filename, | ||
| int | line_number ) |
Check / fix ns-3 #include headers using angle brackets <> rather than quotes "" in a line.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information)
Definition at line 753 of file check-style-clang-format.py.
| Tuple[bool, str, List[str]] check-style-clang-format.check_licenses_line | ( | str | line, |
| str | filename, | ||
| int | line_number ) |
Check / fix SPDX licenses rather than GPL text in a line.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information)
Definition at line 845 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.
Args:
filename: Name of the file to be checked.
fix: Whether to fix (True) or just check (False) the style of the file.
verbose: Show the lines that are not compliant with the style.
respect_clang_format_guards: Whether to respect clang-format guards.
check_style_line_function: Function used to check each line.
Returns:
Tuple (Filename,
Whether the file is compliant with the style (before the check),
Verbose information)
Definition at line 634 of file check-style-clang-format.py.
| bool check-style-clang-format.check_style_clang_format | ( | List[str] | paths, |
| Dict[str, bool] | checks_enabled, | ||
| bool | fix, | ||
| bool | verbose, | ||
| int | n_jobs = 1 ) |
CHECK STYLE MAIN FUNCTIONS.
Check / fix the coding style of a list of files.
Args:
paths: List of paths to the files to check.
checks_enabled: Dictionary of checks indicating whether to enable each of them.
fix: Whether to fix (True) or just check (False) the file.
verbose: Show the lines that are not compliant with the style.
n_jobs: Number of parallel jobs.
Returns:
Whether all files are compliant with all enabled style checks.
Definition at line 318 of file check-style-clang-format.py.
References check_style_files(), find_clang_format_path(), and find_files_to_check_style().
| 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.
Args:
style_check_str: Description of the check to be performed.
check_style_file_function: Function used to check the file.
filename: Name of the file to be checked.
fix: Whether to fix (True) or just check (False) the file (True).
verbose: Show the lines that are not compliant with the style.
n_jobs: Number of parallel jobs.
kwargs: Additional keyword arguments to the check_style_file_function.
Returns:
Whether all files are compliant with the style.
Definition at line 441 of file check-style-clang-format.py.
Referenced by check_style_clang_format().
| 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.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information)
Definition at line 990 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.
Args:
line: The line to check.
filename: Name of the file to be checked.
line_number: The number of the line checked.
Returns:
Tuple (Whether the line is compliant with the style (before the check),
Fixed line,
Verbose information)
Definition at line 955 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.
Returns:
Path to clang-format.
Raises:
RuntimeError: If no supported version of clang-format is found.
Definition at line 269 of file check-style-clang-format.py.
Referenced by check_style_clang_format().
| Dict[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.
Args:
paths List of paths to the files to check.
Returns:
Dictionary of checks and corresponding list of files to check.
Example: {
"formatting": list_of_files_to_check_formatting,
...,
}
Definition at line 219 of file check-style-clang-format.py.
References should_analyze_directory(), and should_analyze_file().
Referenced by check_style_clang_format().
| bool check-style-clang-format.should_analyze_directory | ( | str | dirpath | ) |
AUXILIARY FUNCTIONS.
Check whether a directory should be analyzed.
Args:
dirpath: Directory path.
Returns:
Whether the directory should be analyzed.
Definition at line 178 of file check-style-clang-format.py.
Referenced by find_files_to_check_style().
| 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.
Args:
path: Path to the file.
files_to_check: List of files that shall be checked.
file_extensions_to_check: List of file extensions that shall be checked.
Returns:
Whether the file should be analyzed.
Definition at line 193 of file check-style-clang-format.py.
Referenced by find_files_to_check_style().
| check-style-clang-format.action |
Definition at line 1044 of file check-style-clang-format.py.
| bool check-style-clang-format.all_checks_successful |
Definition at line 1128 of file check-style-clang-format.py.
| check-style-clang-format.args = parser.parse_args() |
Definition at line 1125 of file check-style-clang-format.py.
Definition at line 76 of file check-style-clang-format.py.
| int check-style-clang-format.CLANG_FORMAT_MAX_VERSION = 20 |
PARAMETERS.
Definition at line 43 of file check-style-clang-format.py.
| int check-style-clang-format.CLANG_FORMAT_MIN_VERSION = 20 |
Definition at line 44 of file check-style-clang-format.py.
| check-style-clang-format.default |
Definition at line 1121 of file check-style-clang-format.py.
Definition at line 58 of file check-style-clang-format.py.
| str check-style-clang-format.FILE_ENCODING = "UTF-8" |
Definition at line 172 of file check-style-clang-format.py.
Definition at line 106 of file check-style-clang-format.py.
Definition at line 89 of file check-style-clang-format.py.
Definition at line 71 of file check-style-clang-format.py.
Definition at line 52 of file check-style-clang-format.py.
Definition at line 46 of file check-style-clang-format.py.
| check-style-clang-format.help |
Definition at line 1047 of file check-style-clang-format.py.
| check-style-clang-format.nargs |
Definition at line 1046 of file check-style-clang-format.py.
| check-style-clang-format.parser |
Definition at line 1031 of file check-style-clang-format.py.
| check-style-clang-format.sep |
Definition at line 1159 of file check-style-clang-format.py.
| int check-style-clang-format.TAB_SIZE = 4 |
Definition at line 171 of file check-style-clang-format.py.
| check-style-clang-format.type |
Definition at line 1045 of file check-style-clang-format.py.