Wiki

Clone wiki

codeaster-src / AslintMessagesIdentifiers

Messages identifiers

Description

This documentation is automatically extracted from :file:`aslint.base_checkers`

This module defines the generic objects to check source files.

There are several classes for each type of checking and derivated classes for each type of error or warning. There is a convenient class CheckList to register the messages to check for a type of checking and source type (it simply avoids import * or to forget to register a check, use checkers_from_context too).

A warning or error message is an instance of one of these classes. All the messages for a source file are stored in a MsgList object (if the same error is raised twice, there will be two objects of the same class in the MsgList store).

An instance of the Report class allows to store the MsgList instances for all the checked source files.

Each message has a unique identifier. This is compulsory to be registered in a CheckList object and a good practice at all.

The docstring of each message contains a short description on the first line, and then a longer description that gives the developer some possibilities to suppress it.

The messages identifiers are as 'Xijnn' and follow the following rules.

The 'X' letter means:
  • 'E' as 'Error': this is an error, we cannot pass over (for example because the compiler stops).
  • 'C' as 'Convention': this could be a warning but we consider that it must not occur in the source files. So it is as worse as 'E' and can not be tolerated.
  • 'W' as 'Warning': this is a warning. Good practices should fix it but in some cases, it cannot be removed and has to be tolerated.
  • 'R' as 'Refactoring': this could be use in future to detect or mark code that needs refactoring.
  • 'I' as 'Information': just an information, a recommendation (disabled warnings are reported as 'I').
The first digit 'i' defines the type of checking:
  • 0: check of fortran source files using a compiler
  • 1: check of fortran source files using textual analysis
  • 2: check of testcase files
  • 3: check of C source files
  • 4: check of python source files
  • 5: check of data files (material and geometrical data)
  • 6: check of catalog files (command and elements)
  • 9: check of filenames
The second digit 'j' defines the type of error/warning:
  • 0: language/syntax errors
  • 1: arguments passing
  • 2: types
  • 3: declarations
  • 4: standard conformance
  • 5: coding conventions
First two digits for special categories:
  • 88: disabled, hidden messages
  • 99: sentinels messages

The last two digits 'nn' are the number of the message in this subtype.

Example: 'E0102' is an error (E) reported by the compiler (0) concerning the argument passing (1) and this is a message (02) is this category.

To list all the registered messages (and check the unicity of the ids), run the unittest test_messages of __init__.py of the aslint package:

cd $HOME/dev/codeaster/devtools/lib/aslint
python _test_aslint.py -doc TestAslint.build_messages_doc

List of messages

  • E0001 Unclassifiable statement

  • E0002 Invalid character

  • E0003 Invalid unit

  • C0004 Line truncated

  • C0005 Invalid X descriptor

  • E0006 Invalid form of statement

  • W0007 Missing continous character '&'

  • E0101 Type mismatch

  • I0102 Procedure called with an implicit interface

    This message is only used to "ignore" this before that the interface have been added.

  • E0103 Rank mismatch

  • W0104 Dummy argument

  • E0105 Too few elements in argument

  • E0106 Too many arguments

  • E0107 Not enough arguments

  • C0108 Uninitialized variable

  • C0109 Maybe uninitialized variable

  • W0202 Possible change of value in conversion

  • E0203 No implicit type

  • W0204 Operands of comparison operator mismatch

  • W0205 Same variable used for IN and OUT argument

    The same variable is used for an input and an output argument.

  • W0206 Problem of alignment of variables

  • E0301 Duplicate external declaration

  • W0302 Unused variable

  • W0303 Unused parameter

  • W0304 Unused label

  • C0305 Symbol used before being typed

  • E0306 Expected another dimension in array declaration

  • W0307 Unused (function) parameter

  • C0308 Call with an implicit interface

    An explicit interface must be defined to call an external subprogram. You must add the corresponding include statement for this subprogram.

  • C0401 Nonconforming tab character

  • W0402 Character will be truncated

  • C0403 Character is truncated

  • C0404 Obsolescent feature

    Source code may not work unaltered with modern compilers. See http://fortranwiki.org/fortran/show/Modernizing+Old+Fortran

    DATA statements should be replaced by adding the PARAMETER attribute.

    Example:

    character(len=3) :: tchar(2)
    data tchar /'AAA', 'BBB'/
    

    replaced by:

    character(len=3), parameter :: tchar(2) = (/'AAA', 'BBB'/)
    
  • W0405 Equivalence between different types

  • E0406 Missing comma

  • C0407 Nonstandard type declaration

  • C0408 Deprecated Hollerith constant

  • W0409 Deleted feature

  • C0410 Unexpected type for array index

  • C0411 Real array index

  • C0412 Double complex

  • W0413 Equality/inequality comparison for floating-point numbers

    It is unsafe to rely on exact floating-point comparisons. Slight variations in rounding can change the outcome of such comparisons, leading to non-convergence or other unexpected behavior. It is relevant only if the variables have been assigned with the same value. Prefer use: abs(a-b) < abs((a+b)/2)*r8prem() to test equality with a small tolerance. We should only compare to r8vide() or other assigned numbers.

  • C0414 Unary operator following arithmetic operator

    The same code may be compiled differently by different compilers. Example: d1=a**-2*b gets interpretted as d1=a**(-2*b) by ifort but as d1=(a**-2)*b by gfortran.

  • C1001 implicit none

  • C1002 Unauthorized statement

    These statements should not be used: stop, return, intrinsic, entry, dimension, equivalence, include. Prefer use '#include' instead of the 'include' fortran statement.

  • W1003 Unrecommended statement

    These statements should not be used: utalrm, allocate, deallocate. ALLOCATE/DEALLOCATE should be replaced by AS_ALLOCATE/AS_DEALLOCATE.

  • C1004 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C1005 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and version management. Example:

  • W1006 Another Copyright than EDF

  • E1007 Filename used more than once

    A filename must not be used several times.

  • E1008 Interface file is required for each subroutine

    An interface is required for each fortran subroutine or function. For a xxxx.F90 file, a file defining the interface must exist in include/<subdirectory>/xxxx.h. The modules must be named xxxx_module.F90 (or xxxx_type.F90 for the definition of types).

  • E1009 Interface without a fortran subroutine

    An interface (.h) exists for a fortran subroutine that does not exist.

  • C1010 Numbered subroutine out of range

    Developpers must not add 'te', 'op' or 'lc' subroutines out of the predefined range: 'te' <= 600, 'op' < 200, 'lc' <= 100.

  • C1301 Expected another dimension in array declaration

    Size of arrays must be explicitly declared: 'array(0:)' is not tolerated, use 'array(0:N)' instead.

  • C1302 Double precision type not allowed

    'double precision' should be replaced by 'real(kind=8)'. Ref. http://fortranwiki.org/fortran/show/Real+precision

  • W1303 Character variable too long

    Character variables size must not exceed 256 characters.

  • W1304 Unrecommended declaration of integer/logical

    Integer and logical variables should not be declared with an explicit range. Do not use 'integer(kind=...)', just 'integer' or 'logical'.

  • W1305 Unrecommended declaration of real/complex

    Real and complex variables should be declared with an explicit range and in most case, it should be 'real(kind=8)' or 'complex(kind=8)'.

  • W1306 Automatic arrays

    Automatic arrays must be used with care of their size.

  • W1307 Variable name too long

    The maximum length for a variable name is 16.

  • C1308 Missing interface file

    An include statement is required for each called subroutine. The included file should define the interface of the subroutine. This checking must be run from 'src' to find include files correctly. The interface can also be provided by a module but the USE statement that renames the symbols (=>) is not supported.

  • C1309 Interface mismatch

    The subroutine and its interface must have the same arguments. The arguments must have the same name because it is required with optional arguments. The declaration of the arguments must be stricly identical.

  • C1310 Uninitialized pointer

    Pointers must be initialized to 'null()'.

  • C1311 Subroutine name too long

    The maximum length for a subroutine name is 32.

  • C1312 Unrecommended IF statement before macros, use if (...) then ... end if

    The syntax without then (also called "logical if") is considered archaic and may cause unexpected error when a macro is replaced by several statements (only the first one is really under the condition).

    Ref.: http://en.wikibooks.org/wiki/Fortran/Fortran_control

  • C1313 Kind value of real/complex is required

    Real and complex variables must be declared with an explicit range and in most case, it should be 'real(kind=8)' or 'complex(kind=8)'.

  • C1401 Nonstandard syntax

  • C1402 Nonstandard type declaration

    'real*8' and similar declarations must no longer be used. Ref. http://fortranwiki.org/fortran/show/Real+precision

  • W1403 No executable statement

  • W1501 More than 500 lines

  • W1502 More than 19 continuation lines

  • C1503 No subroutine, function or module defined

    If you defined a module, it must be named.

  • W1504 More than 20 arguments

  • C1505 Declaration with continuation line

    For readibility the declarations must not be continued. This is only allowed for the declarations of constant arrays (with parameter attribute).

  • C1506 Inline comment

  • I1507 Label only before continue or format

    For loop, use do/end do.

  • I1508 Recommendation: 3 digits max. for labels

  • C1509 Line too long

    Lines must not be too long for readability and convention. Maximum line length is 100 columns in Code_Aster fortran source files.

  • C1511 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • C1512 ASSERT must be on a single line

    The fortran preprocessor does not always support macros on several lines. It depends on the preprocessor version.

  • C1513 Compilation directives are not recommended

    Compilation directives must only be used for strong reasons.

  • E2001 Data file not found

    The datafile referenced in the export file does not exist

  • C2002 Size of datafiles too big

  • E2003 Invalid export file

    Required parameters: memory_limit, time_limit, testlist.

    testlist must contain verification or validation, and, sequential or parallel. Additional name lists are accepted: seism, performance.

  • C2004 File not used by any testcase

    A file is in the directory of the testcases but it is not used by any testcase.

  • W2005 Unrecommended keyword in a command file

    This keyword should not be used in a testcase: TOLE_MACHINE.

  • C2006 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C2007 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • C2008 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • C2009 Testcase resources are too big

    Time limit must be less than 300 s, memory limit less than 1024 MB in 'src'. This error can be ignored in the 'validation' repository".

  • W2010 Testcase in the submit list removed

    A testcase is in the list of the testcases passed during the submit but this testcase does not exist anymore. Please contact the administrator to remove the testcase from the list.

  • C2011 Required keyword in a command file

    A testcase must use one of operators DEBUT or POURSUITE and the keyword CODE.

  • W2012 Unrecommended value assigned to a keyword in a command file

    This value should be assigned wit care in this repository.

  • C2013 Duplicated data files

    Datafiles can be shared between testcases through the .export definition. Do not add the same file several times.

  • C2014 Same as RequiredKeyword for branch 'v11'

  • C2015 Invalid filename for a testcase

  • C2055 Unrecommended keyword in a command file

    This keyword should not be used in a testcase: TOLE_MACHINE.

  • C3001 Line too long

    Lines must not be too long for readability and convention. Maximum line length is 100 columns in C.

  • C3002 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C3003 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • W3004 Another Copyright than EDF

  • C3005 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • C4001 Line too long

    Lines must not be too long for readability and convention. Maximum line length is 80 columns in python (see http://www.python.org/dev/peps/pep-0008).

  • C4002 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C4003 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • W4004 Another Copyright than EDF

  • C4005 Encoding definition is required in the first or second line

    Conforming to PEP0263, the encoding of the source file must be defined by placing a magic comment as first or second line of the file (see http://www.python.org/dev/peps/pep-0263/).

  • C4006 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • W5001 Unexpected filename

    Only this suffix are allowed: '.datg'

  • W5002 Unexpected filename

    Only this suffix is allowed: '.mater'

  • C5003 Encoding definition is required in the first or second line

    Conforming to PEP0263, the encoding of the source file must be defined by placing a magic comment as first or second line of the file (see http://www.python.org/dev/peps/pep-0263/).

  • C5004 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C5005 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • W5006 Another Copyright than EDF

  • C5007 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C5008 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • W5009 Another Copyright than EDF

  • C5010 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • C6001 Invalid encoding, expecting ascii

    'cata' files must be encoded in ascii.

  • C6002 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C6003 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • C6004 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • C6005 Summary with GPL is required

    The copyright and GPL summary are required. Even if there is an external copyright, it must mention www.code-aster.org

  • C6006 EDF R&D Copyright not found

    Even if there is a copyright to another company than EDF R&D, the source has been changed for Code_Aster conformance and/or version management. Example:

  • C6008 Invalid character, unexpected tabulation 't'

    Tabulation character is not allowed.

  • W6009 Another Copyright than EDF

  • W6010 Another Copyright than EDF

  • C8501 Invalid encoding, expecting utf-8

    Source files must be encoded in utf-8 (or ascii).

  • C8502 Invalid end of line, expecting 'n' not 'rn'

  • C8503 Copyright is out of date, must be updated to the current year

    See fix_copyright tool (use --help option for details).

  • I8801 Person in charge

    The person in charge of this module will be notified if one submit a request for integration of these changes.

  • C8802 Invalid address for the person in charge

    The email address must not contain space and must have a '@'.

  • C8882 Obsolete syntax: please remove this line from the old source manager

    This is an obsolete marker not used anymore Must be removed.

  • C8883 Obsolete syntax: please remove this line from the old source manager

    This is the obsolete format to store the modification date. Must be removed.

  • C8884 Obsolete format of disabled message

    This is the obsolete format to disable conformance warnings. Must be removed.

  • C8885 Obsolete syntax: please use 'person_in_charge: email@domain.com'

    This is the obsolete format to declare the person in charge. Must be removed.

  • I8886 Messages hidden for header files

  • W8888 Disabled message(s)

    Used to disable a warning that can not be removed in a special case

  • W8889 New disabled message(s)

    If you added or changed one, please check if it can be removed instead of disabled.

  • W9001 Change not authorized on this file

    Some files can not be changed by developers, contact an administrator if you must change one.

  • C9002 Unsupported extension

    Only these extensions are allowed for testcases: .comm, .com[0-9], .py, .data, .datg, .export, .mail, .mgib, .mmed, .msh, .msup, .[0-9]+

  • C9003 Unused or missing messages

    All error messages must be called in a source file and all messages called must exist.

  • W9004 Requirements missed to check spelling of messages (supv002a will fail)

    The testcase supv002a checks the spelling of error messages. It requires aspell and the dictionnaries $ASTER_ROOT/share/codeaster/code_aster_dict.aspell.per and code_aster_cata.aspell.per. Dictionnaries files can be built using $HOME/dev/codeaster/devtools/bin/maint/make_code_aster_dict --installdir=$ASTER_ROOT/share/codeaster

  • C9005 Permission of source files must be rw-r--r--

    Use $HOME/dev/codeaster/devtools/bin/fix_permission to fix that.

  • C9006 Reserved filename

    These patterns are reserved to identify fortran types and modules definition : xxxx_type.F90 for public types, xxxx_module.F90 for modules.

  • E9990 Error

  • E9991 Error

  • W9992 Warning

  • W9993 Warning

Updated