Skip to content

Commit

Permalink
Add maybe to message
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Jun 28, 2022
1 parent 625fd50 commit 973935c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/formatters/__tests__/githubFormatter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ test('githubFormatter', () => {

expect(githubFormatter(results, returnValue))
.toBe(`::error file=path/to/file.css,line=1,col=2,endLine=1,endColumn=5,title=Stylelint problem::Unexpected "foo" (foo) - https://stylelint.io/rules/foo
::warning file=a.css,line=10,col=20,title=Stylelint problem::Unexpected "bar" (bar) [fixable]`);
::warning file=a.css,line=10,col=20,title=Stylelint problem::Unexpected "bar" (bar) [maybe fixable]`);
});
2 changes: 1 addition & 1 deletion lib/formatters/__tests__/verboseFormatter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,6 @@ describe('verboseFormatter', () => {
file.css
1 error found
no-foo: 1 (fixable)`);
no-foo: 1 (maybe fixable)`);
});
});
2 changes: 1 addition & 1 deletion lib/formatters/githubFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function buildMessage(msg, metadata) {
if (!metadata) return msg;

const url = metadata.url ? ` - ${metadata.url}` : '';
const fixable = metadata.fixable ? ' [fixable]' : '';
const fixable = metadata.fixable ? ' [maybe fixable]' : '';

return `${msg}${fixable}${url}`;
}
2 changes: 1 addition & 1 deletion lib/formatters/verboseFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function verboseFormatter(results, returnValue) {

for (const [rule, list] of Object.entries(problemsByRule)) {
const meta = metadata[rule];
const fixable = meta && meta.fixable ? ' (fixable)' : '';
const fixable = meta && meta.fixable ? ' (maybe fixable)' : '';

output += dim(` ${ruleLink(rule, meta)}: ${list.length}${fixable}\n`);
}
Expand Down

0 comments on commit 973935c

Please sign in to comment.