Class CheckUtils
- java.lang.Object
-
- org.sonar.iac.docker.checks.utils.CheckUtils
-
public final class CheckUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetFileExtension(String name)static Optional<Flag>getParamByName(Collection<Flag> params, String name)static <T extends CommandInstruction>
BiConsumer<CheckContext,T>ignoringExecForm(BiConsumer<CheckContext,T> visitor)Only execute the visitor if this CommandInstruction is not an ExecForm.static <T extends CommandInstruction>
BiConsumer<CheckContext,T>ignoringHeredoc(BiConsumer<CheckContext,T> visitor)static List<ArgumentResolution>resolveInstructionArguments(HasArguments instructionWithArguments)
-
-
-
Method Detail
-
resolveInstructionArguments
public static List<ArgumentResolution> resolveInstructionArguments(HasArguments instructionWithArguments)
-
getParamByName
public static Optional<Flag> getParamByName(Collection<Flag> params, String name)
-
ignoringHeredoc
public static <T extends CommandInstruction> BiConsumer<CheckContext,T> ignoringHeredoc(BiConsumer<CheckContext,T> visitor)
-
ignoringExecForm
public static <T extends CommandInstruction> BiConsumer<CheckContext,T> ignoringExecForm(BiConsumer<CheckContext,T> visitor)
Only execute the visitor if this CommandInstruction is not an ExecForm.
Unlike the shell form, the exec form does not invoke a command shell. This means that normal shell processing does not happen. Thus, checks about shell best practices are not applicable to commands in ExecForm.
-
-