fix: apply suggested changes

Signed-off-by: François Gouteroux <francois.gouteroux@gmail.com>
This commit is contained in:
François Gouteroux 2023-05-28 19:55:00 +02:00 committed by Bryan Boreham
parent 488ece2899
commit 7f1f842eba

View file

@ -127,7 +127,7 @@ func main() {
checkRulesCmd := checkCmd.Command("rules", "Check if the rule files are valid or not.")
ruleFiles := checkRulesCmd.Arg(
"rule-files",
"The rule files to check, default is read from standard input (STDIN).",
"The rule files to check, default is read from standard input.",
).ExistingFiles()
checkRulesLint := checkRulesCmd.Flag(
"lint",
@ -699,7 +699,7 @@ func CheckRules(ls lintConfig, files ...string) int {
failed := false
hasErrors := false
// add empty string to avoid matching filename
// Add empty string to avoid matching filename.
if len(files) == 0 {
files = append(files, "")
}
@ -732,7 +732,7 @@ func checkRules(filename string, lintSettings lintConfig) (int, []error) {
var rgs *rulefmt.RuleGroups
var errs []error
// if filename is an empty string it is a stdin
// Empty string is stdin input.
if filename == "" {
data, err := io.ReadAll(os.Stdin)
if err != nil {