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

Add documentation for too-many-lines #8235

Closed
wants to merge 3 commits into from
Closed

Add documentation for too-many-lines #8235

wants to merge 3 commits into from

Conversation

ollie-iterators
Copy link
Contributor

Type of Changes

Type
βœ“ πŸ› Bug fix
βœ“ ✨ New feature
βœ“ πŸ”¨ Refactoring
βœ“ πŸ“œ Docs

Description

Adding documentation for too-many-lines

Refs #5953

Closes #XXXX

@clavedeluna clavedeluna added the Skip news πŸ”‡ This change does not require a changelog entry label Feb 8, 2023
Copy link
Contributor

@clavedeluna clavedeluna left a comment

Choose a reason for hiding this comment

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

I'd argue that the good v. bad examples are confusing because by adding code that's actually different (loop in good v. lots of print statements in bad), it's honing in on other code issues and not just too many lines in the module.

I'd suggest doing something way simpler, make the config for line number be something small like 3 and then have almost identical code in good/bad files but just one more line in bad.

@ollie-iterators
Copy link
Contributor Author

ollie-iterators commented Feb 8, 2023

I'd argue that the good v. bad examples are confusing because by adding code that's actually different (loop in good v. lots of print statements in bad), it's honing in on other code issues and not just too many lines in the module.

I'd suggest doing something way simpler, make the config for line number be something small like 3 and then have almost identical code in good/bad files but just one more line in bad.

@clavedeluna - Ok, do you think this code for bad.py is good:

Imports

import datetime
from datetime import datetime
from datetime import date, timedelta

print("Current date and time: " , datetime.datetime.now())
print("Current year: ", datetime.date.today().strftime("%Y"))
print("Month of year: ", datetime.date.today().strftime("%B"))
print("Week number of the year: ", datetime.date.today().strftime("%W"))
print("Weekday of the week: ", datetime.date.today().strftime("%w"))
print("Day of year: ", datetime.date.today().strftime("%j"))
print("Day of the month : ", datetime.date.today().strftime("%d"))
print("Day of week: ", datetime.date.today().strftime("%A"))

And a for loop with some of those values in a list for the good.py file?

@clavedeluna
Copy link
Contributor

How about something as simple as:

max line number : 3

bad.py
print(1)
print(2)
print(3)

good:
print(1)
print(2)

but maybe another maintainer will disagree with me

@Pierre-Sassoulas
Copy link
Member

#8219 (review)
#7897 (comment)

Please don't reopen issue when it was already rejected, you're wasting everyone's time.

@ollie-iterators
Copy link
Contributor Author

#8219 (review) #7897 (comment)

Please don't reopen issue when it was already rejected, you're wasting everyone's time.

@Pierre-Sassoulas Please look at the discussion that was happening above.

@Pierre-Sassoulas
Copy link
Member

Too many lines is not a message that can be properly reported with a good/bad example, it's also not a concept that is hard to grasp and absolutely needs an example to be understood. But it does need a rational. This is why we're going to use a template without good/bad to document it.

I've already reviewed your proposal yesterday and closed your issue, please take reviews and review comments into account if you want to keep contributing to pylint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip news πŸ”‡ This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants