Miscellaneous-NoIncludePaths¶
Avoid using forbidden kinds of paths in #include
Required inputs: IR
Example
#include "header.h" // ok #include "/include/header.h" // bad - if not "allow_absolute_paths" #include "./header.h" // bad - if not "allow_same_directory" #include "../header.h" // bad - if not "allow_upward_paths" #include "include/header.h" // bad - if not "allow_downward_paths"
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
include_with_forbidden_path_kind |
Avoid using forbidden kinds of paths in #include. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allow_absolute_paths¶
allow_absolute_paths : bool = False
#includes.
allow_downward_paths¶
allow_downward_paths : bool = False
#include "a/b/c" cases.
allow_same_directory¶
allow_same_directory : bool = False
#include "./file" cases.
allow_upward_paths¶
allow_upward_paths : bool = False
#include "../a" cases.
use_scanner¶
use_scanner : bool = False