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

Update: make max-lines report the actual number of lines (fixes #6766) #6764

Merged
merged 1 commit into from Aug 10, 2016

Conversation

jrencz
Copy link
Contributor

@jrencz jrencz commented Jul 26, 2016

What issue does this pull request address?
It makes max-lines report the actual number of lines along with the limit.

What changes did you make? (Give an overview)
I altered the report message and updated max-lines test suite.

Is there anything you'd like reviewers to focus on?
Report output. May it be better?

Instead of reporting only that max value has been exceeded
it now also reports how many lines there is in the file.

@mention-bot
Copy link

@jrencz, thanks for your PR! By analyzing the annotation information on this pull request, we identified @alberto to be a potential reviewer

@eslintbot
Copy link

Thanks for the pull request, @jrencz! I took a look to make sure it's ready for merging and found some changes are needed:

  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@jquerybot
Copy link

Thank you for your pull request. It looks like this may be your first contribution to a jQuery Foundation project, if so we need you to sign our Contributor License Agreement (CLA).

📝 Please visit http://contribute.jquery.org/CLA/ to sign.

After you signed, the PR is checked again automatically after a minute. If there's still an issue, please reply here to let us know.


If you've already signed our CLA, it's possible your git author information doesn't match your CLA signature (both your name and email have to match), for more information, check the status of your CLA check.

@eslintbot
Copy link

Thanks for the pull request, @jrencz! I took a look to make sure it's ready for merging and found some changes are needed:

  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

Thanks for the pull request, @jrencz! I took a look to make sure it's ready for merging and found some changes are needed:

  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@jrencz jrencz changed the title Update: make max-lines report the actual number of lines Update: make max-lines report the actual number of lines (fixes #6766) Jul 26, 2016
@alberto alberto added the do not merge This pull request should not be merged yet label Jul 26, 2016
@jrencz
Copy link
Contributor Author

jrencz commented Jul 28, 2016

@alberto may you please describe why "do not merge" was applied?

Most other PRs with "do not merge" have some kind of description.

I'm not sure if I have to do something more or you just have to think about this.

@vitorbal
Copy link
Member

@jrencz thanks a lot for the PR. It was marked as "do not merge" simply because the proposal has not been accepted by the team yet.
As soon as the proposal is marked as accepted on the original issue, we'll remove the "do not merge" label from here, so nothing to do for now on your part.

@jrencz
Copy link
Contributor Author

jrencz commented Jul 28, 2016

@vitorbal thank you

@jrencz jrencz force-pushed the max-lines-report-actual-lines branch from b90606a to 807b20d Compare August 4, 2016 08:16
@eslintbot
Copy link

LGTM

@@ -21,11 +21,13 @@ const ruleTester = new RuleTester();

/**
* Returns the error message with the specified max number of lines
* @param {number} lines Maximum number of lines
* @param {number} limitLines Maximum number of lines
* @param {number} actualLines Maximum number of lines
Copy link
Member

Choose a reason for hiding this comment

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

could you update the description of this param? Should be "Actual number of lines" I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, my bad

@vitorbal vitorbal removed the do not merge This pull request should not be merged yet label Aug 4, 2016
@vitorbal
Copy link
Member

vitorbal commented Aug 4, 2016

LGTM, but waiting another day for others to take a look

…int#6766)

Instead of reporting only that `max` value has been exceeded
it now also reports how many lines there is in the file.
@jrencz jrencz force-pushed the max-lines-report-actual-lines branch from 807b20d to 62e0b01 Compare August 4, 2016 14:13
@eslintbot
Copy link

LGTM

@gyandeeps
Copy link
Member

LGTM except I think we need to make the message little short.

@@ -139,7 +139,11 @@ module.exports = {
if (lines.length > max) {
context.report({
loc: { line: 1, column: 0 },
message: "File must be at most " + max + " lines long."
message: "File must be at most {{max}} lines long. It's {{actual}} lines long.",
Copy link
Member

@vitorbal vitorbal Aug 5, 2016

Choose a reason for hiding this comment

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

@gyandeeps to address your concern: how about:

"File must be at most {{max}} lines long, was {{actual}}."

Although I don't feel like it's too long right now, do we have some guidelines on the maximum length of the error messages we should generate?

Copy link
Member

Choose a reason for hiding this comment

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

We don't have any guidelines, and I agree that it looks reasonably short to me.

@ilyavolodin
Copy link
Member

LGTM. @gyandeeps Do you want to make message shorter or are you OK with merging this as is?

@gyandeeps
Copy link
Member

that wasn't a very strong opinion. That was just my take but if other fine then i am fine. 😄

@vitorbal vitorbal merged commit d610d6c into eslint:master Aug 10, 2016
@vitorbal
Copy link
Member

Alright, merging then. Thanks a lot for your contribution, @jrencz! 🎉

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 6, 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.

None yet

9 participants