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
Conversation
Thanks for the pull request, @jrencz! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
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. |
f27f022
to
67c199c
Compare
Thanks for the pull request, @jrencz! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
67c199c
to
b90606a
Compare
Thanks for the pull request, @jrencz! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
max-lines
report the actual number of linesmax-lines
report the actual number of lines (fixes #6766)
@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. |
@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. |
@vitorbal thank you |
b90606a
to
807b20d
Compare
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 |
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.
could you update the description of this param? Should be "Actual number of lines" I think
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.
Right, my bad
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.
807b20d
to
62e0b01
Compare
LGTM |
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.", |
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.
@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?
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.
We don't have any guidelines, and I agree that it looks reasonably short to me.
LGTM. @gyandeeps Do you want to make message shorter or are you OK with merging this as is? |
that wasn't a very strong opinion. That was just my take but if other fine then i am fine. 😄 |
Alright, merging then. Thanks a lot for your contribution, @jrencz! 🎉 |
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 exceededit now also reports how many lines there is in the file.