Skip to content
Snippets Groups Projects
Commit 6feb9888 authored by Mathieu Courtois's avatar Mathieu Courtois
Browse files

Merge branch 'mc-identifiers' into 'main'

[#34228] 'identifier' keywords must be removed

See merge request codeaster/devtools!39
parents b6042486 39115a28
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,6 @@ REG_EXT = ( ...@@ -45,7 +45,6 @@ REG_EXT = (
class UnsupportedExtension(FilenameCat, GenericMsg): class UnsupportedExtension(FilenameCat, GenericMsg):
"""Unsupported extension """Unsupported extension
Only these extensions are allowed for testcases: .comm, .com[0-9], .py, Only these extensions are allowed for testcases: .comm, .com[0-9], .py,
.data, .datg, .export, .mail, .mgib, .mmed, .msh, .msup, .[0-9]+""" .data, .datg, .export, .mail, .mgib, .mmed, .msh, .msup, .[0-9]+"""
...@@ -62,7 +61,6 @@ class UnsupportedExtension(FilenameCat, GenericMsg): ...@@ -62,7 +61,6 @@ class UnsupportedExtension(FilenameCat, GenericMsg):
class InvalidFilename(FilenameCat, TextMsgNotFound): class InvalidFilename(FilenameCat, TextMsgNotFound):
"""Invalid filename for a testcase """Invalid filename for a testcase
Filenames matching 'aaaaNNNm.\*', 'aaaaNNNm\_\*.comm', 'aaaaNNNm\_\*.py', Filenames matching 'aaaaNNNm.\*', 'aaaaNNNm\_\*.comm', 'aaaaNNNm\_\*.py',
'subdir/\*.py' or 'NNN.med' are expected. 'subdir/\*.py' or 'NNN.med' are expected.
...@@ -96,7 +94,6 @@ class InvalidFilename(FilenameCat, TextMsgNotFound): ...@@ -96,7 +94,6 @@ class InvalidFilename(FilenameCat, TextMsgNotFound):
class FileNotUsed(DirnameCat, GenericMsg): class FileNotUsed(DirnameCat, GenericMsg):
"""File not used by any testcase """File not used by any testcase
A file is in the directory of the testcases but it is not used by any A file is in the directory of the testcases but it is not used by any
testcase.""" testcase."""
...@@ -124,7 +121,6 @@ class FileNotUsed(DirnameCat, GenericMsg): ...@@ -124,7 +121,6 @@ class FileNotUsed(DirnameCat, GenericMsg):
class DatafileNotFound(DirnameCat, GenericMsg): class DatafileNotFound(DirnameCat, GenericMsg):
"""Data file not found """Data file not found
The datafile referenced in the export file does not exist.""" The datafile referenced in the export file does not exist."""
...@@ -158,7 +154,6 @@ class DatafileNotFound(DirnameCat, GenericMsg): ...@@ -158,7 +154,6 @@ class DatafileNotFound(DirnameCat, GenericMsg):
class DatafileTooBig(FilenameCat, GenericMsg): class DatafileTooBig(FilenameCat, GenericMsg):
"""Size of datafiles too big""" """Size of datafiles too big"""
apply_to = [".export"] apply_to = [".export"]
...@@ -197,7 +192,6 @@ class DatafileTooBigV(DatafileTooBig): ...@@ -197,7 +192,6 @@ class DatafileTooBigV(DatafileTooBig):
class CommonFilesSrcValidation(DirnameCat, GenericMsg): class CommonFilesSrcValidation(DirnameCat, GenericMsg):
"""Filename used in src and validation """Filename used in src and validation
The same filename can not be used in src and validation because the both The same filename can not be used in src and validation because the both
files are installed into the same destination directory.""" files are installed into the same destination directory."""
...@@ -391,7 +385,6 @@ class InvalidExportValid(FilenameCat, InvalidExport): ...@@ -391,7 +385,6 @@ class InvalidExportValid(FilenameCat, InvalidExport):
class ResourcesTooBig(FilenameCat, GenericMsg): class ResourcesTooBig(FilenameCat, GenericMsg):
"""Testcase resources are too big """Testcase resources are too big
Time limit must be less than 300 s, memory limit less than 1024 MB in 'src'. 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".""" This error can be ignored in the 'validation' repository"."""
...@@ -430,7 +423,6 @@ class ResourcesTooBig(FilenameCat, GenericMsg): ...@@ -430,7 +423,6 @@ class ResourcesTooBig(FilenameCat, GenericMsg):
class DuplicatedDataFile(DirnameCat, GenericMsg): class DuplicatedDataFile(DirnameCat, GenericMsg):
"""Duplicated data files """Duplicated data files
Datafiles can be shared between testcases through the .export definition. Datafiles can be shared between testcases through the .export definition.
Do not add the same file several times.""" Do not add the same file several times."""
...@@ -467,7 +459,6 @@ class DuplicatedDataFile(DirnameCat, GenericMsg): ...@@ -467,7 +459,6 @@ class DuplicatedDataFile(DirnameCat, GenericMsg):
class BaseUnrecommendedKeyword(TextMsg): class BaseUnrecommendedKeyword(TextMsg):
"""Unrecommended keyword in a command file """Unrecommended keyword in a command file
This keyword should not be used in a testcase: TOLE_MACHINE.""" This keyword should not be used in a testcase: TOLE_MACHINE."""
...@@ -477,7 +468,6 @@ class BaseUnrecommendedKeyword(TextMsg): ...@@ -477,7 +468,6 @@ class BaseUnrecommendedKeyword(TextMsg):
class UnrecommendedKeyword(FileContentCat, BaseUnrecommendedKeyword): class UnrecommendedKeyword(FileContentCat, BaseUnrecommendedKeyword):
"""Unrecommended keyword in a command file """Unrecommended keyword in a command file
This keyword should not be used in a testcase: TOLE_MACHINE.""" This keyword should not be used in a testcase: TOLE_MACHINE."""
...@@ -485,7 +475,6 @@ class UnrecommendedKeyword(FileContentCat, BaseUnrecommendedKeyword): ...@@ -485,7 +475,6 @@ class UnrecommendedKeyword(FileContentCat, BaseUnrecommendedKeyword):
class NewUnrecommendedKeyword(DiffCat, BaseUnrecommendedKeyword): class NewUnrecommendedKeyword(DiffCat, BaseUnrecommendedKeyword):
"""Unrecommended keyword in a command file """Unrecommended keyword in a command file
This keyword should not be used in a testcase: TOLE_MACHINE.""" This keyword should not be used in a testcase: TOLE_MACHINE."""
...@@ -502,7 +491,6 @@ class ObsoleteKeyword(FileContentCat, TextMsg): ...@@ -502,7 +491,6 @@ class ObsoleteKeyword(FileContentCat, TextMsg):
class InvalidKeywordValue(FileContentCat, GenericMsg): class InvalidKeywordValue(FileContentCat, GenericMsg):
"""Unrecommended value assigned to a keyword in a command file """Unrecommended value assigned to a keyword in a command file
This value should be assigned with care in this repository.""" This value should be assigned with care in this repository."""
...@@ -542,8 +530,26 @@ class InvalidKeywordValueError(FileContentCat, GenericMsg): ...@@ -542,8 +530,26 @@ class InvalidKeywordValueError(FileContentCat, GenericMsg):
return err return err
class DeprecatedComment(FileContentCat, TextMsg): class InvalidKeywordError(FileContentCat, GenericMsg):
"""Invalid keyword in a command file"""
id = "C2015"
_invalid = ["identifier"]
_expr = [re.compile(f"(?P<kwd>{kwd}) *=", re.M) for kwd in _invalid]
_recom = re.compile("^ *#.*$", re.M)
def search(self, txt):
"""Check a command file for invalid values"""
err = []
txt = self._recom.sub("", txt)
for expr in self._expr:
mat = expr.search(txt)
if mat:
err.append(": %s" % (mat.group("kwd"),))
return err
class DeprecatedComment(FileContentCat, TextMsg):
"""Deprecated comment in a command file """Deprecated comment in a command file
This comment (TITRE) should not be used in a testcase: the title is stored This comment (TITRE) should not be used in a testcase: the title is stored
in the documentation.""" in the documentation."""
...@@ -555,7 +561,6 @@ class DeprecatedComment(FileContentCat, TextMsg): ...@@ -555,7 +561,6 @@ class DeprecatedComment(FileContentCat, TextMsg):
class LicenseNotFound(FileContentCat, COMM.LicenseNotFound): class LicenseNotFound(FileContentCat, COMM.LicenseNotFound):
"""Summary with GPL is required """Summary with GPL is required
The copyright and GPL summary are required. Even if there is an external The copyright and GPL summary are required. Even if there is an external
copyright, it must mention www.code-aster.org""" copyright, it must mention www.code-aster.org"""
...@@ -565,7 +570,6 @@ class LicenseNotFound(FileContentCat, COMM.LicenseNotFound): ...@@ -565,7 +570,6 @@ class LicenseNotFound(FileContentCat, COMM.LicenseNotFound):
class EDFCopyright(FileContentCat, COMM.EDFCopyright): class EDFCopyright(FileContentCat, COMM.EDFCopyright):
"""EDF R&D Copyright not found """EDF R&D Copyright not found
Even if there is a copyright to another company than EDF R&D, the source 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. has been changed for Code_Aster conformance and/or version management.
...@@ -582,6 +586,7 @@ class EDFCopyright(FileContentCat, COMM.EDFCopyright): ...@@ -582,6 +586,7 @@ class EDFCopyright(FileContentCat, COMM.EDFCopyright):
class InvalidCharacter(FileContentCat, COMM.InvalidCharacter): class InvalidCharacter(FileContentCat, COMM.InvalidCharacter):
r"""Invalid character, unexpected tabulation '\t' r"""Invalid character, unexpected tabulation '\t'
Tabulation character is not allowed.""" Tabulation character is not allowed."""
apply_to = COMM_EXT apply_to = COMM_EXT
id = "C2008" id = "C2008"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment