Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit cecc34f

Browse files
chore: make messaging clearer
1 parent 0d661e4 commit cecc34f

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

utils/rulesets.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { codigaApiFetch } from "./api";
33
import { ACTION_TOKEN_ADD, CODIGA_CONFIG_FILE } from "./constants";
44
import { getRootDirectory } from "./git";
55
import { GET_RULESETS_FOR_CLIENT } from "../graphql/queries";
6-
import { printCommandSuggestion, printFailure } from "./print";
6+
import { printCommandSuggestion, printFailure, printSuggestion } from "./print";
77

88
/**
99
* Gets an array of rulesets and their rules
@@ -39,13 +39,21 @@ export function getRulesetsFromCodigaFile() {
3939

4040
// if there isn't a rulesets value in the codiga.yml file, throw an error
4141
if (!parsedFile) {
42-
printFailure("No rulesets value found in your `codiga.yml` file");
42+
printFailure("There is no rulesets value in your `codiga.yml` file");
43+
printSuggestion(
44+
" ↳ Ensure you have a `rulesets:` value in: ",
45+
codigaFileLocation
46+
);
4347
process.exit(1);
4448
}
4549

4650
// if there aren't any ruleset items under `rulesets:` in the codiga.yml file, throw an error
4751
if (!parsedFile.rulesets) {
48-
printFailure("No rulesets found in your `codiga.yml` file");
52+
printFailure("There were no rulesets found in your `codiga.yml` file");
53+
printSuggestion(
54+
" ↳ Ensure you have rulesets listed in: ",
55+
codigaFileLocation
56+
);
4957
process.exit(1);
5058
}
5159

0 commit comments

Comments
 (0)