InitialExternalAnnotations

Code annotations provided here which should be placed at the beginning of selected files

Required inputs: IR

This rule can be used to provide code annotations that apply at the beginning of source files. For example, if you use the code annotation format EnableDisable, you can use the following entries in option initial_comments:
  • Filename pattern \*.inc and value AXIVION DISABLE
  • Filename pattern \*MemMap\*.h and values
    • AXIVION DISABLE Style MisraC2012-20.5: AUTOSAR permitted
    • AXIVION DISABLE STYLE MisraC-1.1 : nesting level of #if is not in scope of memmap (AUTOSAR)
These comments would suppress the rules mentioned in the comment (MisraC2012-20.5 resp. MisraC-1.1) in all files matching the given globbing patterns (suffix inc for the first case and header filenames containing the substring MemMap). Additionally, these comments provide a justification for the suppressions, namely the text behind the colon.

Possible Messages

This rule has no predefined messages.

Options

The following places define options that affect this rule: CodeAnnotations, Analysis-GlobalOptions

initial_comments

initial_comments : dict[bauhaus.analysis.config.FileGlobPattern, list[str]] = {}

Maps paths/filename globbing patterns to analysis control comments which should be inserted at the beginning of these files for analysis purposes. The comment may be a single one or a list of comments.