7.7.2.6. Module axivion.config.code_annotations¶
Classes¶
|
Enumeration of possible actions to trigger |
|
Selection of the parser to extract the affected entity from a comment |
|
Description of an issue passed in to deferred comment parser functions |
|
Enumeration of possible issue kinds to address with a comment |
|
Selection of the parser to extract the justification from a comment |
|
Selection of the parser to extract the affected macro from a comment |
|
Selection of the parser to extract the affected messages from a comment |
|
Selection of the parser to extract the affected message keys from a comment |
|
Selection of the parser to extract the affected rules from a comment |
|
Enumeration of possible code regions being addressed with a comment |
Action¶
- class axivion.config.code_annotations.Action(value)¶
Bases:
EnumEnumeration of possible actions to trigger
- NONE = 1¶
Comment does not trigger any action.
- ACTIVATE = 2¶
Activate the given rule(s) in the given scope.
- SUPPRESS = 3¶
Suppress the given rule(s) in the given scope.
- COMMENT = 4¶
Only add a justification to issues in the given scope.
- ENABLE_DISABLE_KEYWORD = 5¶
ENABLE to activate, DISABLE to suppress the given rule(s) in the given scope.
- PLUS_MINUS_KEYWORD = 6¶
to activate, - to suppress the given rule(s) in the given scope.
- BEGIN_END_SUPPRESS_KEYWORD = 7¶
begin to activate, end to suppress the given rule(s) in the given scope.
- RHAPSODY_ENABLE_DISABLE_KEYWORD = 8¶
[ to activate, ] to suppress the given rule(s) in the given scope.
- CUSTOM_PARSER = 9¶
Entity¶
- class axivion.config.code_annotations.Entity(value)¶
Bases:
EnumSelection of the parser to extract the affected entity from a comment
- ENTITY_NAME = 1¶
Entity directly given by name
- ENTITY_AS_GLOBBING = 2¶
Makes entity* out of the given entity
- ENTITY_REGEX = 3¶
The given string for the entity is a regex to match against actual entities
- CUSTOM_PARSER = 4¶
Issue¶
IssueKind¶
- class axivion.config.code_annotations.IssueKind(value)¶
Bases:
EnumEnumeration of possible issue kinds to address with a comment
- STYLE = 1¶
Matches all stylecheck issues.
- METRIC = 2¶
Matches all metric issues.
- ARCHITECTURE = 3¶
Matches all architecture check issues.
- CLONE = 4¶
Matches all clone detection issues.
- CYCLE = 5¶
Matches all cycle detection issues.
- DEAD = 6¶
Matches all dead code issues.
- ALL = 7¶
Matches all issue kinds.
- ISSUE_KIND_KEYWORD = 8¶
The issue kind is read from the comment where the following keywords can be used for the different issue kinds: <ul> <li>’Style’ or ‘Stylecheck’ for stylecheck issues</li> <li>’Metric’ or ‘Metrics’ for metric issues</li> <li>’Architecture’ for architecture issues</li> <li>’Clone’ or ‘Clones’ for clone issues</li> <li>’Cycle’ or ‘Cycles’ for cycle issues</li> <li>’Dead’ or ‘DeadCode’ for dead code issues</li> <li>’All’ for all issue kinds</li> </ul>
- CUSTOM_PARSER = 9¶
Justification¶
- class axivion.config.code_annotations.Justification(value)¶
Bases:
EnumSelection of the parser to extract the justification from a comment
- FULL_TEXT = 1¶
The full text of the matched regex group is the justification
- AFTER_COLON = 2¶
Strip away a leading
:to extract the justification
- CUSTOM_PARSER = 3¶
Macro¶
- class axivion.config.code_annotations.Macro(value)¶
Bases:
EnumSelection of the parser to extract the affected macro from a comment
- MACRO_NAME = 1¶
Macro directly given by name
- MACRO_AS_GLOBBING = 2¶
Makes macro* out of the given macro
- MACRO_REGEX = 3¶
The given string for the macro is a regex to match against actual entities
- CUSTOM_PARSER = 4¶
Message¶
- class axivion.config.code_annotations.Message(value)¶
Bases:
EnumSelection of the parser to extract the affected messages from a comment
- FULL_TEXT = 1¶
The full text of the matched regex group is the message
- MESSAGE_AS_GLOBBING = 2¶
Makes message* out of the given message
- MESSAGE_REGEX = 3¶
The given string for the message is a regex to match against actual messages
- MESSAGES_SEPARATED_BY_SPACE = 4¶
Space-separated list of messages given in the comment
- CUSTOM_PARSER = 5¶
MessageKey¶
Rule¶
- class axivion.config.code_annotations.Rule(value)¶
Bases:
EnumSelection of the parser to extract the affected rules from a comment
- AXIVION_NAME = 1¶
Axivion full rule name given in the comment
- AXIVION_NAMES = 2¶
Comma-separated list of Axivion rulenames given in the comment
- AXIVION_NAMES_SEPARATED_BY_SPACE = 3¶
Space-separated list of Axivion rulenames given in the comment
- MISRA_C_2004_NUMBER = 4¶
Only the number (like 10.1) is given
- MISRA_C_2012_NUMBER = 5¶
Only the number with optional R or D prefix (like 1.1, R1.1, or D1.1) is given
- MISRA_C_2019_NUMBER = 6¶
Only the number with optional R or D prefix (like 1.1, R1.1, or D1.1) is given
- MISRA_C_2023_NUMBER = 7¶
Only the number with optional R or D prefix (like 1.1, R1.1, or D1.1) is given
- MISRA_C_2025_NUMBER = 8¶
Only the number with optional R or D prefix (like 1.1, R1.1, or D1.1) is given
- MISRA_CPP_2008_NUMBER = 9¶
Only the number (like 10.1.1) is given
- MISRA_CPP_2023_NUMBER = 10¶
Only the number (like 10.1.1) is given
- LINT_NUMBER = 11¶
A single lint rule number (like 715) is given
- LINT_NUMBERS = 12¶
A comma-separated list of lint rule numbers is given
- LINT_SAMELINE_NUMBERS = 13¶
A space-separated list of lint rule numbers, each preceded by !e
- PRQA_NUMBER = 14¶
A single PRQA rule number (like 1234) is given
- PRQA_NUMBERS = 15¶
A comma-separated list of PRQA rule numbers is given
- PARASOFT_NAME = 16¶
A single rule name in Parasoft name format is given
- POLYSPACE_NAME = 17¶
A single rule name in Polyspace name format is given
- CUSTOM_PARSER = 18¶
Scope¶
- class axivion.config.code_annotations.Scope(value)¶
Bases:
EnumEnumeration of possible code regions being addressed with a comment
- REST_OF_FILE = 1¶
Comment affects all issues in subsequent lines of the file until a corresponding suppressing comment
- SAME_LINE = 2¶
Comment affects all issues in the same line
- NEXT_LINE = 3¶
Comment affects all issues in the next line
- PREVIOUS_LINE = 4¶
Comment affects all issues in the previous line
- SAME_CONSTRUCT = 5¶
Comment affects all issues inside the statement, lambda or declaration in which the comment itself is placed (e.g., in same statement sequence)
- NEXT_CONSTRUCT = 6¶
Comment affects all issues in the next statement, lambda or declaration, whatever comes earlier
- NEXT_CONSTRUCT_OR_DIRECTIVE = 7¶
Comment affects all issues in the next statement, lambda, declaration, #line or #pragma, whatever comes earlier
- NEXT_CODELINE = 8¶
Comment affects all issues in the first line of the next statement, lambda, declaration, expression, #line or #pragma, whatever comes earlier
- PREVIOUS_CONSTRUCT = 9¶
Comment affects all issues in the preceding statement, lambda or declaration
- SAME_ROUTINE = 10¶
Comment affects all issues in the routine inside which the comment is placed.
- NEXT_ROUTINE = 11¶
Comment affects all issues in the next routine after the comment
- PREVIOUS_ROUTINE = 12¶
Comment affects all issues in the previous routine before the comment
- PROJECT = 13¶
Comment affects the whole project (no scope restriction)
- NEXT_N_LINES = 14¶
Comment affects all issues in the next N lines, where N is parsed from the comment (0 or empty string means “same line”, negative means “previous N lines”); ATTENTION: if an omitted optional match group should mean “same line” then you have to write it as <code>(regex|)</code> and not <code>(regex)?</code> so that the match group matches the empty string and not <code>None</code>
- ROUTINE_BY_NAME = 15¶
The affected routine is named in the comment
- MACRO_BY_NAME = 16¶
Comment affects all issues in invocations of the given macros. Globbing patterns are supported for the macro names.
- FILE = 17¶
Comment affects all issues in the same file as the comment.
- CUSTOM_PARSER = 18¶