Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Store rule severity in messages, rather than pulling from the config on-demand #985

Merged
merged 1 commit into from Jun 19, 2014

Conversation

jonvuri
Copy link
Contributor

@jonvuri jonvuri commented Jun 17, 2014

Fixes #984.

This stores the rule severity on the message objects created when a rule generates a report. This ensures that the severity is always what the rule gets at that instant, regardless of anything that's affected the config up to that point. It also removes all dependency on the config from the formatters, they now depend only on the messages.

@@ -81,7 +81,7 @@ function printResults(config) {
console.error("Could not find formatter '%s'.", config.format);
return false;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

They no longer need the config, the only thing they were using it for was to obtain rule severity.

Copy link
Member

Choose a reason for hiding this comment

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

That might be true now, however, there are custom formatters out there in the wild that will break if we just remove it. We need to do a removal in two steps: first we deprecate its usage and then we actually remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Added 'config' parameter back. What's your procedure for deprecations, anything I should add for that or will it just go in the changelog? Should this be "Breaking: " instead of "Fix: "?

Copy link
Member

Choose a reason for hiding this comment

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

It's technically not breaking at this point, so I'd stick with "Fix:". Just
put "deprecates config for formatters" somewhere in there.​

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In what? A comment in the code? Description on the commit? Both?

@jonvuri
Copy link
Contributor Author

jonvuri commented Jun 17, 2014

Apparently Github expects you to be adding notes below the changes, not above them. Oh well.

@nzakas
Copy link
Member

nzakas commented Jun 19, 2014

Can you add "; deprecates passing full config to Formatters" in your commit message?

@jonvuri
Copy link
Contributor Author

jonvuri commented Jun 19, 2014

Done. Not sure why it isn't updating here.

@jonvuri
Copy link
Contributor Author

jonvuri commented Jun 19, 2014

Proooobably because that was the wrong branch and commit. NOW it's done.

@nzakas
Copy link
Member

nzakas commented Jun 19, 2014

Thanks!

nzakas added a commit that referenced this pull request Jun 19, 2014
Fix: Store rule severity in messages, rather than pulling from the config on-demand
@nzakas nzakas merged commit c16ab9d into eslint:master Jun 19, 2014
@jonvuri jonvuri deleted the rule-severity-in-message branch July 5, 2014 17:52
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Severity of rule should be stored in message
2 participants