MariaDB / mariadb_kernel

A MariaDB Jupyter kernel
BSD 3-Clause "New" or "Revised" License
30 stars 21 forks source link

Use static analysis tools #28

Closed KartikSoneji closed 1 year ago

KartikSoneji commented 3 years ago

Static analysis tools will help improve code quality and avoid common mistakes.

Suggestions:

In the current codebase:

pylint:

mariadb_kernel\maria_magics\line_magic.py:21:0: W0223: Method 'execute' is abstract in class 'MariaMagic' but is not overridden (abstract-method)
mariadb_kernel\maria_magics\line_magic.py:21:0: W0223: Method 'help' is abstract in class 'MariaMagic' but is not overridden (abstract-method)
mariadb_kernel\maria_magics\line_magic.py:21:0: W0223: Method 'name' is abstract in class 'MariaMagic' but is not overridden (abstract-method)
mariadb_kernel\maria_magics\line_magic.py:25:4: W0105: String statement has no effect (pointless-string-statement)

pyroma:

# local clone
$ pyroma .
------------------------------
Checking .
Found mariadb_kernel
------------------------------
The classifiers should specify what minor versions of Python you support as well as what major version.
Your package does not have keywords data.
Specifying a development status in the classifiers gives users a hint of how stable your software is.
------------------------------
Final rating: 9/10
Cottage Cheese
------------------------------

# checking PyPI
$ pyroma --pypi mariadb_kernel
------------------------------
Checking mariadb_kernel
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /pypi/mariadb_kernel/json HTTP/1.1" 301 222
https://pypi.org:443 "GET /pypi/mariadb-kernel/json HTTP/1.1" 200 3867
Found mariadb_kernel version 0.1.1
Downloading mariadb_kernel-0.1.1.tar.gz to verify distribution
Starting new HTTPS connection (1): files.pythonhosted.org:443
https://files.pythonhosted.org:443 "GET /packages/2f/d4/adad2d7816c6f49fccc36d054b837fb270b37df5c05b943237e44bb64cd9/mariadb_kernel-0.1.1.tar.gz HTTP/1.1" 200 4683121
Found mariadb-kernel
------------------------------
The classifiers should specify what minor versions of Python you support as well as what major version.
Your package does not have keywords data.
You should have three or more owners of the project on PyPI.
Specifying a development status in the classifiers gives users a hint of how stable your software is.
------------------------------
Final rating: 8/10
Philadelphia
------------------------------
LinuxJedi commented 1 year ago

This would be a good enhancement to the CI.

KartikSoneji commented 1 year ago

Hi, which tools should be added to the CI? pylint and pyroma should be easy fixes but adding type hints to the code is a significant project, and maybe should be a separate issue?

LinuxJedi commented 1 year ago

Hi, which tools should be added to the CI? pylint and pyroma should be easy fixes but adding type hints to the code is a significant project, and maybe should be a separate issue?

I think pylint is the bare minimum. We can try others too.