Skip to content

Commit

Permalink
fix: remove redundant message / standardize warning messages (#140)
Browse files Browse the repository at this point in the history
* fix: removed redundant info and changed standard messages

* changed log on markdown introspection
  • Loading branch information
marianesoares authored Jan 6, 2022
1 parent e1bfc86 commit 279d9be
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion core/plugins/stack/css/linters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const introspect: IntrospectFn<Linters> = async (context) => {
if (anyValue(linters)) return linters;

if (context.suggestDefault) {
logger.warning("No CSS linter detected, using stylelint");
logger.warning("No CSS linter detected, using Stylelint");
return {
stylelint: { name: "stylelint" },
};
Expand Down
3 changes: 1 addition & 2 deletions core/plugins/stack/markdown/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export const introspector: Introspector<MarkdownProject> = {
},
introspect: async (context) => {
const logger = await context.getLogger("markdown");
logger.info("Detected Markdown File");

logger.debug("detected markdown file");
return {};
},
};
4 changes: 2 additions & 2 deletions core/plugins/stack/python/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const introspect: IntrospectFn<Formatters> = async (context) => {
} else {
if (context.suggestDefault) {
logger.warning(
"No formatters for python were identified in the project, creating default pipeline with 'black' WITHOUT any specific configuration",
"No Python formatter detected, using Black",
);
formatters.black = {
isDependency: false,
Expand All @@ -35,7 +35,7 @@ export const introspect: IntrospectFn<Formatters> = async (context) => {
} else {
if (context.suggestDefault) {
logger.warning(
"No formatters for python were identified in the project, creating default pipeline with 'isort' WITHOUT any specific configuration",
"No Python linter detected, using isort",
);
formatters.isort = {
isDependency: false,
Expand Down
4 changes: 2 additions & 2 deletions core/plugins/stack/python/linters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const introspect: IntrospectFn<Linters> = async (context) => {
} else {
if (context.suggestDefault) {
logger.warning(
"No linters for python were identified in the project, creating default pipeline with 'flake8' WITHOUT any specific configuration",
"No Python linter detected, using Flake8",
);
linters.flake8 = {
isDependency: false,
Expand All @@ -43,7 +43,7 @@ export const introspect: IntrospectFn<Linters> = async (context) => {
} else {
if (context.suggestDefault) {
logger.warning(
"No linters for python were indentified in the project, creating default with 'bandit' WITHOUT any specific configuration",
"No Python linter detected, using Bandit",
);
linters.bandit = {
isDependency: false,
Expand Down
2 changes: 1 addition & 1 deletion core/plugins/stack/ruby/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const introspect: IntrospectFn<Formatters> = async (context) => {
} else {
if (context.suggestDefault) {
logger.warning(
"No formatters for ruby were identified in the project, creating default pipeline with 'Rubocop' WITHOUT any specific configuration",
"No Ruby formatter detected, using Rubocop",
);
formatters.rubocop = {
isDependency: false,
Expand Down
2 changes: 1 addition & 1 deletion core/plugins/stack/ruby/linters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const introspect: IntrospectFn<Linters> = async (context) => {
} else {
if (context.suggestDefault) {
logger.warning(
"No linters for ruby were identified in the project, creating default pipeline with 'Rubocop' WITHOUT any specific configuration",
"No Ruby linter detected, using Rubocop",
);
linters.rubocop = {
isDependency: false,
Expand Down
1 change: 0 additions & 1 deletion core/plugins/stack/ruby/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const introspector: Introspector<RubyProject | undefined> = {
},
introspect: async (context) => {
const logger = context.getLogger("ruby");
logger.info("Detected Ruby File");

// Version
logger.debug("detecting version");
Expand Down
18 changes: 9 additions & 9 deletions tests/default_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ test(
);
assertStringIncludes(
stdout,
"No linters for python were identified in the project, creating default pipeline with 'flake8' WITHOUT any specific configuration",
"No Python linter detected, using Flake8",
);
assertStringIncludes(
stdout,
"No formatters for python were identified in the project, creating default pipeline with 'black' WITHOUT any specific configuration",
"No Python formatter detected, using Black",
);
assertEquals(code, 0);
await assertExpectedFiles();
Expand All @@ -62,11 +62,11 @@ test(
assertStringIncludes(stdout, "Detected stack: python");
assertStringIncludes(
stdout,
"No linters for python were identified in the project, creating default pipeline with 'flake8' WITHOUT any specific configuration",
"No Python linter detected, using Flake8",
);
assertStringIncludes(
stdout,
"No formatters for python were identified in the project, creating default pipeline with 'isort' WITHOUT any specific configuration",
"No Python linter detected, using isort",
);
assertEquals(code, 0);
await assertExpectedFiles();
Expand All @@ -80,15 +80,15 @@ test(

assertStringIncludes(
stdout,
"No linters for python were identified in the project, creating default pipeline with 'flake8' WITHOUT any specific configuration",
"No Python linter detected, using Flake8",
);
assertStringIncludes(
stdout,
"No formatters for python were identified in the project, creating default pipeline with 'black' WITHOUT any specific configuration",
"No Python formatter detected, using Black",
);
assertStringIncludes(
stdout,
"No formatters for python were identified in the project, creating default pipeline with 'isort' WITHOUT any specific configuration",
"No Python linter detected, using isort",
);
assertEquals(code, 0);
await assertExpectedFiles();
Expand Down Expand Up @@ -154,7 +154,7 @@ test(
assertStringIncludes(stdout, "Detected stack: markdown, python, shell");
assertStringIncludes(
stdout,
"No formatters for python were identified in the project, creating default pipeline with 'black' WITHOUT any specific configuration",
"No Python formatter detected, using Black",
);
assertEquals(code, 0);
await assertExpectedFiles();
Expand Down Expand Up @@ -184,7 +184,7 @@ test(
assertStringIncludes(stdout, "Detected stack: python");
assertStringIncludes(
stdout,
"No formatters for python were identified in the project, creating default pipeline with 'black' WITHOUT any specific configuration",
"No Python formatter detected, using Black",
);
assertEquals(code, 0);
await assertExpectedFiles();
Expand Down

0 comments on commit 279d9be

Please sign in to comment.