-
Notifications
You must be signed in to change notification settings - Fork 39
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
Require named arguments to fix pylint too-many-positional-arguments #273
Conversation
This needs some more fixes in other places, I had only addressed the errors that showed up first in the tests. |
@clelange : thanks for addressing #272. I noticed the problem yesterday, but I didn't get around to opening a PR. Although it's better programming practice, it's a breaking change to reassign some arguments from positional to keyword-only. Do you anticipate this will break user code? It might be better in the long run to reassign some arguments and I leave the decision to you, but a simple fix would be to add |
Hi @GraemeWatt -- while making some of the changes, I was also thinking about whether this breaks user code or not. So far, it looks like it's only smaller things that would be easy to fix. Forcing more named function parameters would actually make the code better readable and usable, so I'm somewhat in favour of implementing the fixes rather than silencing the linter. |
It really looks like the changes are minor and good to have even though it might break for some edge cases where people don't like named arguments. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
=======================================
Coverage 90.42% 90.42%
=======================================
Files 5 5
Lines 1117 1117
Branches 254 254
=======================================
Hits 1010 1010
Misses 78 78
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thanks, this looks good. I agree that it is better practice not to allow keyword arguments to be given as positional arguments.
Fixes #272
📚 Documentation preview 📚: https://hepdata-lib--273.org.readthedocs.build/en/273/