From 753319f25789879fb3fd6031fd1a38ca6d683d1b Mon Sep 17 00:00:00 2001 From: Richard Panman Date: Sat, 17 Feb 2024 22:40:50 +0000 Subject: [PATCH] Updated pre-commit scripts --- .pre-commit-config.yaml | 7 +++---- build.gradle | 2 +- .../cs/metrics/SuccessMetricsWebApplicationTest.java | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9812c2c..811e660 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,8 +3,7 @@ exclude: 'approved.txt$|.svg$|gradlew' # approved excluded to prevent tests from failing, SVGs are auto-generated by the pipeline repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 - exclude: ^*.approved.txt$ + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -13,12 +12,12 @@ repos: - id: check-added-large-files - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.2.0 + rev: v2.12.0 hooks: - id: pretty-format-java args: [--autofix, --aosp] - repo: https://github.com/jumanjihouse/pre-commit-hooks - rev: 2.1.5 # or specific git tag + rev: 3.0.0 # or specific git tag hooks: - id: shellcheck diff --git a/build.gradle b/build.gradle index e7be725..d4c25e7 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id 'org.sonatype.gradle.plugins.scan' version '2.7.0' id "base" id "jacoco" - id "java" + id "java" } repositories { diff --git a/view-metrics/src/test/java/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.java b/view-metrics/src/test/java/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.java index 6a5d54f..6715e1c 100644 --- a/view-metrics/src/test/java/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.java +++ b/view-metrics/src/test/java/org/sonatype/cs/metrics/SuccessMetricsWebApplicationTest.java @@ -1,5 +1,9 @@ package org.sonatype.cs.metrics; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; + import org.approvaltests.Approvals; import org.approvaltests.namer.NamedEnvironment; import org.approvaltests.namer.NamerFactory; @@ -17,13 +21,10 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; + import java.util.Arrays; import java.util.LinkedList; import java.util.List; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.fail; - // https://spring.io/guides/gs/testing-web/ @SpringBootTest(