Open dblock opened 11 months ago
So, to confirm, when you say one-by-one, it's this approach:
Doing this incrementally, what do you think of breaking this down into an issue per lint? It becomes a much less daunting single task and can be picked up in parallel.
@macohen Yes, I don't expect all the lints to be enabled at once, that's a massive change.
Running utils/build_dists.py results in an error:
Installing collected packages: urllib3, six, idna, charset-normalizer, certifi, requests, python-dateutil, opensearch-py2
Successfully installed certifi-2023.11.17 charset-normalizer-3.3.2 idna-3.6 opensearch-py2-2.4.3 python-dateutil-2.8.2 requests-2.31.0 six-1.16.0 urllib3-1.26.18
$ /var/folders/33/jx0mw87156q2hmtrr_r82s7r0000gs/T/tmpko79lorv/venv/bin/python -c 'from opensearchpy2 import OpenSearch, Q'
Traceback (most recent call last):
File "
Before I go down a rabbit hole, I think there may be some missing instruction about how to use this or it may not work correctly. I see a docstring:
A command line tool for building and verifying releases Can be used for building both 'opensearchpy' and 'opensearchpyX' dists. Only requires 'name' in 'setup.py' and the directory to be changed.
What's the intent of an opensearchpyX distribution? What name and directory should be changed?
@macohen I don't know anything about this one, I would start by checking whether this is dead code/used in any of our release GHA versions.
got that one. it is only called from GitHub Actions. Also, I've been adding a lot of "# pylint: disable=missing-function-docstring" instructions to any function starting with def test or async def test. All of those functions have pretty good descriptions as function names so I thought this would be a good exception. Even wrote a script for it that I'm adding to utils. Could use some improvements on multi-line function definitions...
I was thinking about adding to ignore in pylint in setup.cfg for the test_opensearchpy directory, but that seems too heavy handed...
Should the opensearchpy directory be ignored for pylint? That code is generated (I think) so maybe the generator needs to include the docstrings and other items.
I don't think tests need descriptions, so I would try to ignore test folders for that linter specifically, but not others. The generator definitely should include docstrings.
Tracking them here as I add:
@saimedhi is there a priority on the lints you'd like to see above? I've been tackling them based on what looks interesting to report on and not too much of a rabbit hole. I'll start updating my findings in the comment above as well.
Feel free to address the lints as you see fit; I don't have any specific priorities.
Is your feature request related to a problem?
We enabled pylint in #590. Enable the remaining lints. Here are some top ones.
What solution would you like?
Enable lints in setup.cfg one-by-one.