-
Notifications
You must be signed in to change notification settings - Fork 8
Support v2 Linter API #149
Support v2 Linter API #149
Conversation
We always handle two types of error, exec errors and program stream errors, in the first case we show a notification with the error related information, in the second case we check the exit code and text looking for warnings, if found we will show a warning notification with the warning related information, else an error notification. A new configuration option can suppress the warning notifications to avoid notification spam to the user. This will solve CI errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
package.json
Outdated
"type": "string" | ||
}, | ||
"globalHamlLintYmlFile": { | ||
"default": "", | ||
"description": "Full path to a global Haml lint file, if no other is found", | ||
"type": "string" | ||
}, | ||
"suppressWarnings": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could possibly be misconstrued to mean "Don't show me warning
severity messages".
Maybe a better name would be suppressFailures
? Is there any reason we don't just want to show all errors though? Generally that means something is wrong and the user isn't going to get any usable output otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about changing the message to "Supress non-critical HAML-Lint messages" or a better way, adding an excerpt message to the results and show notification for errors only?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this
const messages = [];
if (output.exitCode !== 0) {
if (output.stderr.toLowerCase().startsWith(warning)) {
messages.push({
severity: warning,
excerpt: `HAML-Lint: ${output.stderr}`,
location: {
file: filePath,
// first line of the file
position: [[0, 0], [0, Infinity]],
},
});
}
} else {
showErrorNotification('HAML-Lint: Unexpected error', output.stderr);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding it as a message looks great to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add the unexpected errors this way too? I mean, without notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I see it is:
- If the message prevents other results from being returned it should be an Atom error notification
- If other results can still be obtained from the linter then it probably should just be converted into a message on the entire first line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
suppressWarnings config. option and warning notification removed. If the message prevents other results from being returned it should be an Atom error notification, if other results can still be obtained from the linter then it probably should just be converted into a message on the entire first line
hehehe
If we modify the specs to match this we must ensure that the ruby versions of the CI have an old compilant syntax (or do a unsafe conditional test case)
|
Error notification if not exit code 0 and is not a warning
Conditional validation to pass tests with old compilant syntax ruby versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good just looking at the code, is it ready to merge?
Yep, it is ready!! |
Fixes #147