-
Notifications
You must be signed in to change notification settings - Fork 11
Initial scaffolding for the new linter, without any rules implemented yet #10
Conversation
… yet. Extracted by rictic from usergenic's #1 PR
warnings = warnings.concat(await rule.check(document)); | ||
} | ||
} catch (error) { | ||
if (error instanceof WarningCarryingException) { |
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.
Can we catch per-rule? That way all rules will try to run if one fails.
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.
If not here, lets file issue and move that code in separate PR?
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.
+1, reworked how we do error handling here, PTAL
We should never crash based on an analysis error, instead we could just turn that error into a warning on the related file.
warnings = warnings.concat(analysisWarnings); | ||
for (const document of documents) { | ||
for (const rule of this._rules) { | ||
warnings = warnings.concat(await rule.check(document)); |
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.
Can we add a TODO (or implement?) here to catch exceptions for the rule.check()
call? I'd be nice if we had a standard warning to push like we do in the _analyzeAll
call.
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.
+1, done
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 is all sorts of LGTM
Thanks for the review! |
Extracted by rictic from usergenic's #1 PR