lint_rules.debug_rules
Classes
Rule to check for argument size mismatch in subroutine/function calls |
|
Rule to check for run-time ubound checks for assumed shape dummy arguments |
- class ArgSizeMismatchRule
Bases:
GenericRule
Rule to check for argument size mismatch in subroutine/function calls
- config = {'max_indirections': 2}
Dict of configuration keys and their default values
These values can be overriden externally in the linter config file and are passed automatically to the
check()
routine.
- static range_to_sum(lower, upper)
Method to convert lower and upper bounds of a
RangeIndex
to aSum
expression.
- static compare_sizes(arg_size, alt_arg_size, dummy_arg_size)
Compare all possible argument size candidates with dummy arg size.
- classmethod get_explicit_arg_size(arg, dims)
Method to return the size of a subroutine argument whose bounds are explicitly declared.
- classmethod get_implicit_arg_size(arg, dims)
Method to return the size of a subroutine argument whose bounds are potentially implicitly declared.
- classmethod check_subroutine(subroutine, rule_report, config, **kwargs)
Method to check for argument size mismatches across subroutine calls. It requires all
CallStatement
nodes to be enriched, and requires all subroutine arguments to not be of typeDeferredTypeSymbol
. Therefore relevant modules should be parsed before parsing the currentSubroutine
.
- class DynamicUboundCheckRule
Bases:
GenericRule
Rule to check for run-time ubound checks for assumed shape dummy arguments
- fixable = True
Indicator for a fixable rule that implements a corresponding
fix()
routine
- static is_assumed_shape(arg)
Method to check if argument is an assumed shape array.
- static get_ubound_checks(subroutine)
Method to return UBOUND checks nested within a
Conditional
.
- classmethod get_assumed_shape_args(subroutine)
Method to return all assumed-shape dummy arguments in a
Subroutine
.
- classmethod check_subroutine(subroutine, rule_report, config, **kwargs)
Method to check for run-time ubound checks for assumed shape dummy arguments
- classmethod fix_subroutine(subroutine, rule_report, config)
Method to fix run-time ubound checks for assumed shape dummy arguments