lint_rules.ifs_arpege_coding_standards

Implementation of rules from the IFS Arpege coding standards as GenericRule

See https://sites.ecmwf.int/docs/ifs-arpege-coding-standards/fortran for the current version of the coding standards.

Classes

FindFloatLiterals([unique, with_ir_node])

A visitor to collects FloatLiteral used in an IR tree.

MissingImplicitNoneRule()

IMPLICIT NONE must be present in all scoping units but may be omitted in module procedures.

MissingIntfbRule()

Calls to subroutines and functions that are provided neither by a module nor by a CONTAINS statement, must have a matching explicit interface block.

MissingKindSpecifierRealLiterals()

OnlyParameterGlobalVarRule()

Only parameters to be declared as global variables.

class MissingImplicitNoneRule

Bases: GenericRule

IMPLICIT NONE must be present in all scoping units but may be omitted in module procedures.

type = 3

The rule type as one of the categories in RuleType

docs = {'id': 'L1', 'title': 'IMPLICIT NONE must figure in all scoping units. Once per module is sufficient.'}

dict with description of the rule

Typically, this should include "id" and "title". Allows for Python’s format specification mini-language in "title" to fill values using data from config, with the field name corresponding to the config key.

classmethod check_for_implicit_none(ir_)

Check for intrinsic nodes that match the regex.

classmethod check_module(module, rule_report, config)

Check for IMPLICIT NONE in the module’s spec.

classmethod check_subroutine(subroutine, rule_report, config, **kwargs)

Check for IMPLICIT NONE in the subroutine’s spec or an enclosing Module scope.

class OnlyParameterGlobalVarRule

Bases: GenericRule

Only parameters to be declared as global variables.

type = 3

The rule type as one of the categories in RuleType

docs = {'id': 'L3', 'title': 'Only parameters to be declared as global variables.'}

dict with description of the rule

Typically, this should include "id" and "title". Allows for Python’s format specification mini-language in "title" to fill values using data from config, with the field name corresponding to the config key.

classmethod check_module(module, rule_report, config)

Perform rule checks on module level

Must be implemented by a rule if applicable.

class MissingIntfbRule

Bases: GenericRule

Calls to subroutines and functions that are provided neither by a module nor by a CONTAINS statement, must have a matching explicit interface block.

type = 3

The rule type as one of the categories in RuleType

docs = {'id': 'L9', 'title': 'Explicit interface blocks required for procedures that are not imported or internal subprograms'}

dict with description of the rule

Typically, this should include "id" and "title". Allows for Python’s format specification mini-language in "title" to fill values using data from config, with the field name corresponding to the config key.

classmethod check_subroutine(subroutine, rule_report, config, **kwargs)

Check all CallStatement and InlineCall for a matching import or interface block.

class MissingKindSpecifierRealLiterals

Bases: GenericRule

type = 3

The rule type as one of the categories in RuleType

fixable = True

Indicator for a fixable rule that implements a corresponding fix() routine

docs = {'id': 'L0', 'title': 'Real Literals must have a kind specifier. '}

dict with description of the rule

Typically, this should include "id" and "title". Allows for Python’s format specification mini-language in "title" to fill values using data from config, with the field name corresponding to the config key.

classmethod check_subroutine(subroutine, rule_report, config, **kwargs)

classmethod fix_subroutinei_test_2(subroutine, rule_report, config, sourcefile=None)

classmethod fix_subroutine_test(subroutine, rule_report, config, sourcefile=None)

classmethod fix_subroutine(subroutine, rule_report, config, sourcefile=None)

classmethod fix_subroutine_working(subroutine, rule_report, config, sourcefile=None)