Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Initial scaffolding for the new linter, without any rules implemented yet #10

Merged
merged 5 commits into from
Dec 22, 2016

Conversation

rictic
Copy link
Contributor

@rictic rictic commented Dec 21, 2016

Extracted by rictic from usergenic's #1 PR

@rictic rictic requested a review from usergenic December 21, 2016 19:53
warnings = warnings.concat(await rule.check(document));
}
} catch (error) {
if (error instanceof WarningCarryingException) {
Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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));
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, done

Copy link
Contributor

@usergenic usergenic left a 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

@rictic
Copy link
Contributor Author

rictic commented Dec 22, 2016

Thanks for the review!

@rictic rictic merged commit 50b7c9e into master Dec 22, 2016
@rictic rictic deleted the minimal-scaffolding branch December 22, 2016 00:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants