From 4f6216a16682cf78210afd15e6013843e63667f4 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Wed, 18 Sep 2024 17:10:15 +0200 Subject: [PATCH] WIP 318 Make HSC CLI type safe --- .../groovy/org/aim42/htmlsanitycheck/cli/HscCommand.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/HscCommand.groovy b/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/HscCommand.groovy index cfc70158..9d68d6de 100644 --- a/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/HscCommand.groovy +++ b/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/HscCommand.groovy @@ -1,5 +1,6 @@ package org.aim42.htmlsanitycheck.cli +import groovy.transform.TypeChecked import org.aim42.htmlsanitycheck.AllChecksRunner import org.aim42.htmlsanitycheck.Configuration import org.aim42.htmlsanitycheck.ProductInformation @@ -10,6 +11,7 @@ import picocli.CommandLine.Option import picocli.CommandLine.Parameters import java.nio.file.Files +import java.nio.file.Path import java.nio.file.Paths import java.util.logging.Formatter import java.util.logging.ConsoleHandler @@ -25,6 +27,7 @@ import java.util.logging.SimpleFormatter description = "Check HTML files for Sanity", showDefaultValues = true ) +@TypeChecked class HscCommand implements Runnable { private static final Logger rootLogger private static ConsoleHandler consoleHandler @@ -109,7 +112,7 @@ class HscCommand implements Runnable { .filter({ path -> suffixes.any { suffix -> path.toString().endsWith(".${suffix}") } }) - .collect { it.toFile() } + .collect { Path path -> path.toFile() } } static class HscRunner {