AutosarC++18_10-A2.8.2

An implementation file name should reflect the logical entity for which it provides definitions

Required inputs: IR

Rationale

Naming an implementation file with a name of a declared type or accordingly to a collection of free functions makes a project structure more clear and readable.

See Also
  • JSF December 2005 [8]: AV Rule 56: The name of an implementation file should reflect the logical entity for which it provides definitions and have a “.cpp” extension (this name will normally be identical to the header file that provides the corresponding declarations.).

Possible Messages

Key

Text

Severity

Disabled

source_file_name_not_type

The file should be named as a type it declares.

None

False

Options

file_type

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

Type of source_file file to examine.
 

junk_characters

junk_characters : str = ' _-.:'

Characters that should not be considered in the filename to type similarity.
 

named_node_types

named_node_types : set[bauhaus.ir.PIR_Class_Name] = {'Definition', 'No_Def_Declaration'}

Physical IR node types to inspect for logical names to compare against the file name
 

similarity_threshold

similarity_threshold : float = 0.9

Ratio of how similar the names need to be.