moonshot-nagayama-pj / PnPQ

Python package for Controlling Optical Devices in Quantum Testbed
Other
0 stars 0 forks source link

Additional static analysis for PnPQ #49

Closed auspicacious closed 4 weeks ago

auspicacious commented 2 months ago

In https://github.com/moonshot-nagayama-pj/PnPQ/issues/31 we added black and ruff to PnPQ.

However, there's some things that black doesn't really do, like sorting imports or enforcing naming conventions.

Black has a page on how to use other tools alongside it: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html

We should integrate isort and pycodestyle at a minimum, and experiment with others.

This is part of epic https://github.com/moonshot-nagayama-pj/testbed-meta/issues/13

auspicacious commented 1 month ago

isort done.

auspicacious commented 1 month ago

pycodestyle doesn't seem to catch anything that black doesn't, at least in our current codebase. It is also less flexible when it comes to line length of docstrings. Not using pycodestyle.

auspicacious commented 1 month ago

pylint detects a lot of helpful stuff, some of it surprisingly specific. We can't enable everything at once (it complains about any TODOs left in code) but we can enable quite a lot.

auspicacious commented 1 month ago

Added pylint with most checks enabled, except those related to documentation and code smells like having too many input arguments.

Added coverage for information about code coverage, just for fun.

I think this task can be considered completed for now. We can probably consider this our baseline for new development going forward. There are a number of other tools, but, presumably, the return on investment will decrease with each one.