AutosarC++18_03-A3.1.2¶
Header files, that are defined locally in the project, shall have a file name’ extension of one of: “.h”, “.hpp” or “.hxx”
Required inputs: IR
| Level | required |
|---|---|
| Target | architecture / design / implementation |
| Enforcement | automated |
Rationale
This is consistent with developer expectations to provide header files with one of the standard file name extensions.
Example
//% $Id: A3-1-2.cpp 266557 2017-02-07 13:08:19Z piotr.tanski $ //#include <h3.h> // Compliant //#include <h1.hpp> // Compliant //#include <h2.hxx> // Compliant //#include <h4.cpp> // Non-compliant //#include <h5.c> // Non-compliant //#include <h6.hdr> // Non-compliant //#include <h7.inc> // Non-compliant
See Also
- JSF December 2005 [7]: 4.9.2 AV Rule 53 Header files will always have a file name extension of ".h".
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
illegal_file_extension |
Use only certain extensions for file names. |
None |
False |
Options¶
This rule shares the following common options: confidence, 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
allowed_extensions¶
allowed_extensions : set[str] = {'.h', '.hpp', '.hxx'}
file_type¶
file_type : bauhaus.rules.axivion.lexical.comments.FileToCheckSet = {'User_Include_File'}