AutosarC++17_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

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

allowed_extensions

allowed_extensions : set[str] = {'.h', '.hpp', '.hxx'}

Which file extensions are allowed.
 

file_type

file_type : bauhaus.rules.axivion.lexical.comments.FileToCheckSet = {'User_Include_File'}

The files to check the extensions of.