From 11cc4cf006e440c2540946b3394b9e4083978423 Mon Sep 17 00:00:00 2001 From: louisjdmartin Date: Thu, 10 Apr 2025 10:24:05 +0200 Subject: [PATCH 1/2] Add EUMETSAT Rules --- src/main/resources/rules/icode-f77-rules.xml | 158 +++++++++++++--- src/main/resources/rules/icode-f90-rules.xml | 171 +++++++++++++++--- .../sonar/plugins/icode/model/ModelTest.java | 4 +- .../icode/rules/ICodeRulesDefinitionTest.java | 4 +- 4 files changed, 275 insertions(+), 62 deletions(-) diff --git a/src/main/resources/rules/icode-f77-rules.xml b/src/main/resources/rules/icode-f77-rules.xml index f969fe4..4730dae 100644 --- a/src/main/resources/rules/icode-f77-rules.xml +++ b/src/main/resources/rules/icode-f77-rules.xml @@ -22,7 +22,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DATA.FloatCompare COM.DATA.FloatCompare * - Equality and non equality (.EQ., ==, .NE., /=) are forbidden on reals (REAL, DOUBLE PRECISION, COMPLEX). + Equality and non equality (.EQ., ==, .NE., /=) are forbidden on reals (REAL, + DOUBLE PRECISION, COMPLEX). MAJOR READY CODE_SMELL @@ -32,7 +33,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DATA.Initialisation COM.DATA.Initialisation * - Variables have to be initialized before being used. When a variable is used, the algorithm should checked if it is initialized and if not throw an error. + Variables have to be initialized before being used. When a variable is used, + the algorithm should checked if it is initialized and if not throw an error. MAJOR READY CODE_SMELL @@ -42,7 +44,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DATA.Invariant COM.DATA.Invariant * - Data declared into subroutine, function, ... and which are never modified then should be declared as constant. + Data declared into subroutine, function, ... and which are never modified then + should be declared as constant. MAJOR READY CODE_SMELL @@ -72,7 +75,9 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DESIGN.Alloc COM.DESIGN.Alloc * - Allocation and desallocation of ressources should be in the same level. For each “DEALLOCATE” keyword found, i-Code CNES checks that the keyword “ALLOCATE” is also found and checks that they are relative to the same resource. + Allocation and desallocation of ressources should be in the same level. For + each “DEALLOCATE” keyword found, i-Code CNES checks that the keyword “ALLOCATE” is also + found and checks that they are relative to the same resource. MAJOR READY CODE_SMELL @@ -102,7 +107,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.BooleanExpression COM.FLOW.BooleanExpression * - In a condition (IF,DO), maximum number of operands is 5 (AND, OR, NEQV, XOR, EQV, NOT, LT, <, LE, <=, GT, >, GE, >=, EQ, ==, NE, /=). + In a condition (IF,DO), maximum number of operands is 5 (AND, OR, NEQV, XOR, + EQV, NOT, LT, <, LE, <=, GT, >, GE, >=, EQ, ==, NE, /=). MAJOR READY CODE_SMELL @@ -152,7 +158,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.FileExistence COM.FLOW.FileExistence * - File opening (OPEN, READ, WRITE) should be done after using INQUIRE and EXIST instruction of this file. + File opening (OPEN, READ, WRITE) should be done after using INQUIRE and EXIST + instruction of this file. MAJOR READY CODE_SMELL @@ -162,7 +169,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.FilePath COM.FLOW.FilePath * - In the OPEN instruction, it is forbidden to use directly the file name (file.txt). Path should be defined through a variable. + In the OPEN instruction, it is forbidden to use directly the file name + (file.txt). Path should be defined through a variable. MAJOR READY CODE_SMELL @@ -172,9 +180,10 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.INST.BoolNegation COM.INST.BoolNegation * - Double negation is forbidden on Boolean expressions. Negations are defined with the keyword « NOT ». Following expressions are not allowed: - NOT. (.NOT. a) -> ( a ) - .NOT. ( a .AND. .NOT. b) -> .NOT. a .OR. b + Double negation is forbidden on Boolean expressions. Negations are defined with + the keyword « NOT ». Following expressions are not allowed: + NOT. (.NOT. a) -> ( a ) + .NOT. ( a .AND. .NOT. b) -> .NOT. a .OR. b MAJOR READY CODE_SMELL @@ -194,7 +203,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.INST.CodeComment COM.INST.CodeComment * - Commented code is forbidden. i-Code CNES checks all keywords in comments, except in the header. + Commented code is forbidden. i-Code CNES checks all keywords in comments, + except in the header. MAJOR READY CODE_SMELL @@ -246,11 +256,11 @@ Please, report this error to i-Code CNES maintainers to improve the tool: * Source code should be indented with spaces: DO i = 2, nb - somme = somme + x(i) - IF (isnan(somme)) THEN - print *, 'somme is a NaN' - moy = -1.0 - END IF + somme = somme + x(i) + IF (isnan(somme)) THEN + print *, 'somme is a NaN' + moy = -1.0 + END IF END DO MAJOR @@ -272,7 +282,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.TYPE.Expression COM.TYPE.Expression * - In a expression (defined by operator like +, -, /, *, **) all variables should have the same type : REAL, INTEGER, … + In a expression (defined by operator like +, -, /, *, **) all variables should + have the same type : REAL, INTEGER, … MAJOR READY CODE_SMELL @@ -302,7 +313,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.BLOC.Function F77.BLOC.Function * - Parameter’s braces should be used when defining a FUNCTION whenever there is no parameter. + Parameter’s braces should be used when defining a FUNCTION whenever there is no + parameter. MAJOR READY CODE_SMELL @@ -322,7 +334,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.DATA.Array F77.DATA.Array * - Arrays dimension should be declared explicitly. The use of * is tolerated for the last one if justified with a comment. + Arrays dimension should be declared explicitly. The use of * is tolerated for + the last one if justified with a comment. MAJOR READY CODE_SMELL @@ -342,7 +355,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.DATA.Double F77.DATA.Double * - In a constant initialisation or in an expression evaluation, the use of (D) (as double precision is mandatory. + In a constant initialisation or in an expression evaluation, the use of (D) (as + double precision is mandatory. MAJOR READY CODE_SMELL @@ -382,7 +396,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.DATA.Parameter F77.DATA.Parameter * - The use of constants, computed values or function calls as function parameters is forbidden. + The use of constants, computed values or function calls as function parameters + is forbidden. MAJOR READY CODE_SMELL @@ -392,7 +407,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.ERR.OpenRead F77.ERR.OpenRead * - The check of return status for instructions OPEN and READ is mandatory. It is recommended to use “IOSTAT = “ to do it. + The check of return status for instructions OPEN and READ is mandatory. It is + recommended to use “IOSTAT = “ to do it. MAJOR READY CODE_SMELL @@ -432,7 +448,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.INST.Function F77.INST.Function * - FUNCTION instruction should be used with an explicite type declaration, at function definition. + FUNCTION instruction should be used with an explicite type declaration, at + function definition. MAJOR READY CODE_SMELL @@ -452,7 +469,9 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.INST.Include F77.INST.Include * - If instruction INCLUDE is used, the included file should not contain executable instructions. (ASSIGN, GOTO, IF, ELSE, CONTINUE, STOP, PAUSE ; DO, READ, WRITE, PRINT, REWIND ; BACKSPACE, ENDFILE, OPEN, CLOSE, INQUIER, CALL, RETURN, END). + If instruction INCLUDE is used, the included file should not contain executable + instructions. (ASSIGN, GOTO, IF, ELSE, CONTINUE, STOP, PAUSE ; DO, READ, WRITE, PRINT, + REWIND ; BACKSPACE, ENDFILE, OPEN, CLOSE, INQUIER, CALL, RETURN, END). MAJOR READY CODE_SMELL @@ -482,7 +501,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.INST.Save F77.INST.Save * - SAVE instruction is forbidden except for local variables with justification in a comment. + SAVE instruction is forbidden except for local variables with justification in + a comment. MAJOR READY CODE_SMELL @@ -572,9 +592,10 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.REF.Parameter F77.REF.Parameter * - It is forbidden to set as subroutine parameter variables which are already in a COMMON bloc accessible from the subroutine and the program which calls it. + It is forbidden to set as subroutine parameter variables which are already in a + COMMON bloc accessible from the subroutine and the program which calls it. MAJOR - + READY CODE_SMELL 30min @@ -583,7 +604,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F77.TYPE.Basic F77.TYPE.Basic * - Only standard types (INTEGER, REAL, DOUBLE PRECISION, COMPLEX, LOGICAL, CHARACTER) are allowed. + Only standard types (INTEGER, REAL, DOUBLE PRECISION, COMPLEX, LOGICAL, + CHARACTER) are allowed. MAJOR READY CODE_SMELL @@ -599,4 +621,84 @@ Please, report this error to i-Code CNES maintainers to improve the tool: CODE_SMELL 30min + + MAJOR + READY + CODE_SMELL + 30min + * + COM.PRES.FileLength + COM.PRES.FileLength + The file must be short + + + MAJOR + READY + CODE_SMELL + 30min + * + COM.MET.LineOfCode + COM.MET.LineOfCode + The number of line of code must be lower + + + MAJOR + READY + CODE_SMELL + 30min + * + COM.FLOW.CheckArguments + COM.FLOW.CheckArguments + You must control every arguments + + + MAJOR + READY + CODE_SMELL + 30min + * + COM.MET.ComplexitySimplified + COM.MET.ComplexitySimplified + The cylcomatic number from Simplified McCabe must be lowered + + + MAJOR + READY + CODE_SMELL + 30min + * + F77.DESIGN.LogicUnit + F77.DESIGN.LogicUnit + Please refer to RNC Q80. + + + MAJOR + READY + CODE_SMELL + 30min + * + COM.MET.RatioComment + COM.MET.RatioComment + You must add more comments on your code + + + MAJOR + READY + CODE_SMELL + 30min + * + COM.PRES.Data + COM.PRES.Data + Please refer to RNC Q80. + + + MAJOR + READY + CODE_SMELL + 30min + * + F77.FILE.Header + F77.FILE.Header + You must add an header to this file + \ No newline at end of file diff --git a/src/main/resources/rules/icode-f90-rules.xml b/src/main/resources/rules/icode-f90-rules.xml index d7fee78..9698f9f 100644 --- a/src/main/resources/rules/icode-f90-rules.xml +++ b/src/main/resources/rules/icode-f90-rules.xml @@ -22,7 +22,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DATA.FloatCompare COM.DATA.FloatCompare * - Equality and non equality (.EQ., ==, .NE., /=) are forbidden on reals (REAL, DOUBLE PRECISION, COMPLEX). + Equality and non equality (.EQ., ==, .NE., /=) are forbidden on reals (REAL, + DOUBLE PRECISION, COMPLEX). MAJOR READY CODE_SMELL @@ -32,7 +33,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DATA.Initialisation COM.DATA.Initialisation * - Variables have to be initialized before being used. When a variable is used, the algorithm should checked if it is initialized and if not throw an error. + Variables have to be initialized before being used. When a variable is used, + the algorithm should checked if it is initialized and if not throw an error. MAJOR READY CODE_SMELL @@ -42,7 +44,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DATA.Invariant COM.DATA.Invariant * - Data declared into subroutine, function, ... and which are never modified then should be declared as constant. + Data declared into subroutine, function, ... and which are never modified then + should be declared as constant. MAJOR READY CODE_SMELL @@ -72,7 +75,9 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.DESIGN.Alloc COM.DESIGN.Alloc * - Allocation and deallocation of ressources should be in the same level. For each “DEALLOCATE” keyword found, i-Code CNES checks that the keyword “ALLOCATE” is also found and checks that they are relative to the same resource. + Allocation and deallocation of ressources should be in the same level. For each + “DEALLOCATE” keyword found, i-Code CNES checks that the keyword “ALLOCATE” is also found + and checks that they are relative to the same resource. MAJOR READY CODE_SMELL @@ -102,7 +107,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.BooleanExpression COM.FLOW.BooleanExpression * - In a condition (IF,DO), maximum number of operands is 5 (AND, OR, NEQV, XOR, EQV, NOT, LT, <, LE, <=, GT, >, GE, >=, EQ, ==, NE, /=). + In a condition (IF,DO), maximum number of operands is 5 (AND, OR, NEQV, XOR, + EQV, NOT, LT, <, LE, <=, GT, >, GE, >=, EQ, ==, NE, /=). MAJOR READY CODE_SMELL @@ -152,7 +158,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.FileExistence COM.FLOW.FileExistence * - File opening (OPEN, READ, WRITE) should be done after using INQUIRE and EXIST instruction of this file. + File opening (OPEN, READ, WRITE) should be done after using INQUIRE and EXIST + instruction of this file. MAJOR READY CODE_SMELL @@ -162,7 +169,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.FilePath COM.FLOW.FilePath * - In the OPEN instruction, it is forbidden to use directly the file name (file.txt). Path should be defined through a variable. + In the OPEN instruction, it is forbidden to use directly the file name + (file.txt). Path should be defined through a variable. MAJOR READY CODE_SMELL @@ -172,9 +180,10 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.INST.BoolNegation COM.INST.BoolNegation * - Double negation is forbidden on Boolean expressions. Negations are defined with the keyword « NOT ». Following expressions are not allowed: - NOT. (.NOT. a) -> ( a ) - .NOT. ( a .AND. .NOT. b) -> .NOT. a .OR. b + Double negation is forbidden on Boolean expressions. Negations are defined with + the keyword « NOT ». Following expressions are not allowed: + NOT. (.NOT. a) -> ( a ) + .NOT. ( a .AND. .NOT. b) -> .NOT. a .OR. b MAJOR READY CODE_SMELL @@ -194,7 +203,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.INST.CodeComment COM.INST.CodeComment * - Commented code is forbidden. i-Code CNES checks all keywords in comments, except in the header. + Commented code is forbidden. i-Code CNES checks all keywords in comments, + except in the header. MAJOR READY CODE_SMELL @@ -246,11 +256,11 @@ Please, report this error to i-Code CNES maintainers to improve the tool: * Source code should be indented with spaces: DO i = 2, nb - somme = somme + x(i) - IF (isnan(somme)) THEN - print *, 'somme is a NaN' - moy = -1.0 - END IF + somme = somme + x(i) + IF (isnan(somme)) THEN + print *, 'somme is a NaN' + moy = -1.0 + END IF END DO MAJOR @@ -272,7 +282,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.TYPE.Expression COM.TYPE.Expression * - In a expression (defined by operator like +, -, /, *, **) all variables should have the same type : REAL, INTEGER, … + In a expression (defined by operator like +, -, /, *, **) all variables should + have the same type : REAL, INTEGER, … MAJOR READY CODE_SMELL @@ -302,7 +313,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: COM.FLOW.Recursion COM.FLOW.Recursion * - Recursion is forbidden. In Fortran, i-Code CNES checks that "RECURSIVE FUNCTION(params)" is not found. + Recursion is forbidden. In Fortran, i-Code CNES checks that "RECURSIVE + FUNCTION(params)" is not found. MAJOR READY CODE_SMELL @@ -332,7 +344,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.DATA.ArrayAccess F90.DATA.ArrayAccess * - In an array of indirections, it is not possible to define the same item several times. + In an array of indirections, it is not possible to define the same item several + times. MAJOR READY CODE_SMELL @@ -383,7 +396,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.DATA.Parameter F90.DATA.Parameter * - Functions SELECTED_REAL_KIND and SELECTED_INT_KIND should be grouped in the same module. + Functions SELECTED_REAL_KIND and SELECTED_INT_KIND should be grouped in the + same module. MAJOR READY CODE_SMELL @@ -437,7 +451,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.ERR.Allocate F90.ERR.Allocate * - Allocation and deallocation should contain “STAT” parameter. Then, « STAT » value should be tested. + Allocation and deallocation should contain “STAT” parameter. Then, « STAT » + value should be tested. MAJOR READY CODE_SMELL @@ -463,7 +479,9 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.ERR.OpenRead F90.ERR.OpenRead * - OPEN and READ instructions, which work on files, should contain IOSTAT parameter and check this variable value. To check this, OPEN instruction should contain FILE attribute. + OPEN and READ instructions, which work on files, should contain IOSTAT + parameter and check this variable value. To check this, OPEN instruction should contain + FILE attribute. MAJOR READY CODE_SMELL @@ -473,7 +491,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.INST.Associated F90.INST.Associated * - Between declaration and ASSOCIATED instruction, it is mandatory to call NULLIFY. + Between declaration and ASSOCIATED instruction, it is mandatory to call + NULLIFY. MAJOR READY CODE_SMELL @@ -503,7 +522,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.INST.If F90.INST.If * - IF followed by one of these instructions : EXIT, GOTO, CYCLE, RETURN is forbidden. + IF followed by one of these instructions : EXIT, GOTO, CYCLE, RETURN is + forbidden. MAJOR READY CODE_SMELL @@ -543,7 +563,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.INST.Operator F90.INST.Operator * - Do not use old notation. Replace .EQ., .NE., .LT., .LE., .GT., .GE. by ==, /=, <, <=, >, >=. + Do not use old notation. Replace .EQ., .NE., .LT., .LE., .GT., .GE. by ==, /=, + <, <=, >, >=. MAJOR READY CODE_SMELL @@ -567,8 +588,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.NAME.GenericIntrinsic * Do not use specific functions (see below), use generic ones: - BAD: result = AMOD (argument, divider) - GOOD: result = MOD (argument, divider) + BAD: result = AMOD (argument, divider) + GOOD: result = MOD (argument, divider) MAJOR READY CODE_SMELL @@ -618,7 +639,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.REF.Label F90.REF.Label * - END keyword should be followed by the type (function, subroutine…) and the name. + END keyword should be followed by the type (function, subroutine…) and the + name. MAJOR READY CODE_SMELL @@ -628,7 +650,8 @@ Please, report this error to i-Code CNES maintainers to improve the tool: F90.REF.Open F90.REF.Open * - Every OPEN instruction should have parameters FILE, STATUS, IOSTAT and POSITION. + Every OPEN instruction should have parameters FILE, STATUS, IOSTAT and + POSITION. MAJOR READY CODE_SMELL @@ -674,4 +697,92 @@ Please, report this error to i-Code CNES maintainers to improve the tool: CODE_SMELL 30min + + * + MAJOR + READY + CODE_SMELL + 30min + COM.PRES.FileLength + COM.PRES.FileLength + The file must be short + + + + * + MAJOR + READY + CODE_SMELL + 30min + COM.MET.LineOfCode + COM.MET.LineOfCode + The number of line of code must be lower + + + + * + MAJOR + READY + CODE_SMELL + 30min + COM.FLOW.CheckArguments + COM.FLOW.CheckArguments + You must control every arguments + + + + * + MAJOR + READY + CODE_SMELL + 30min + COM.MET.ComplexitySimplified + COM.MET.ComplexitySimplified + The cylcomatic number from Simplified McCabe must be lowered + + + + * + MAJOR + READY + CODE_SMELL + 30min + F90.DESIGN.LogicUnit + F90.DESIGN.LogicUnit + Please refer to RNC Q80. + + + + * + MAJOR + READY + CODE_SMELL + 30min + COM.MET.RatioComment + COM.MET.RatioComment + You must add more comments on your code + + + + * + MAJOR + READY + CODE_SMELL + 30min + COM.PRES.Data + COM.PRES.Data + Please refer to RNC Q80. + + + + * + MAJOR + READY + CODE_SMELL + 30min + F90.FILE.Header + F90.FILE.Header + You must add an header to this file + + \ No newline at end of file diff --git a/src/test/java/fr/cnes/sonar/plugins/icode/model/ModelTest.java b/src/test/java/fr/cnes/sonar/plugins/icode/model/ModelTest.java index 0997ced..1446212 100644 --- a/src/test/java/fr/cnes/sonar/plugins/icode/model/ModelTest.java +++ b/src/test/java/fr/cnes/sonar/plugins/icode/model/ModelTest.java @@ -79,14 +79,14 @@ public void test_getters() { public void test_unmarshal_from_file() { InputStream file = this.getClass().getResourceAsStream("/rules/icode-f77-rules.xml"); RulesDefinition def = (RulesDefinition) XmlHandler.unmarshal(file, RulesDefinition.class); - Assert.assertEquals(58, def.getRules().size()); + Assert.assertEquals(66, def.getRules().size()); } @Test public void test_unmarshal_from_stream() { InputStream stream = this.getClass().getResourceAsStream("/rules/icode-f77-rules.xml"); RulesDefinition def = (RulesDefinition) XmlHandler.unmarshal(stream, RulesDefinition.class); - Assert.assertEquals(58, def.getRules().size()); + Assert.assertEquals(66, def.getRules().size()); } @Test diff --git a/src/test/java/fr/cnes/sonar/plugins/icode/rules/ICodeRulesDefinitionTest.java b/src/test/java/fr/cnes/sonar/plugins/icode/rules/ICodeRulesDefinitionTest.java index 8028cbf..6c596a0 100644 --- a/src/test/java/fr/cnes/sonar/plugins/icode/rules/ICodeRulesDefinitionTest.java +++ b/src/test/java/fr/cnes/sonar/plugins/icode/rules/ICodeRulesDefinitionTest.java @@ -28,8 +28,8 @@ public void test_creation_of_repositories_and_rules() { Assert.assertEquals(0, context.repositories().size()); new ICodeRulesDefinition().define(context); Assert.assertEquals(2, context.repositories().size()); - Assert.assertEquals(58, context.repository("f77-rules").rules().size()); - Assert.assertEquals(64, context.repository("f90-rules").rules().size()); + Assert.assertEquals(66, context.repository("f77-rules").rules().size()); + Assert.assertEquals(72, context.repository("f90-rules").rules().size()); } @Test From f933dd0d2cfc8ca3e9b4669ecf3d2492f97baec6 Mon Sep 17 00:00:00 2001 From: louisjdmartin Date: Thu, 10 Apr 2025 10:27:30 +0200 Subject: [PATCH 2/2] Upgrade actions/cache to v4 in github actions --- .github/workflows/draft-release.yml | 2 +- .github/workflows/java-continuous-integration.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 3715df5..47176cd 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -29,7 +29,7 @@ jobs: distribution: 'adopt' java-version: '17' - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/java-continuous-integration.yml b/.github/workflows/java-continuous-integration.yml index 61dbe91..eda3b61 100644 --- a/.github/workflows/java-continuous-integration.yml +++ b/.github/workflows/java-continuous-integration.yml @@ -30,7 +30,7 @@ jobs: distribution: 'adopt' java-version: 17 - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -56,13 +56,13 @@ jobs: distribution: 'adopt' java-version: '17' - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - name: Cache SonarCloud packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar