From 1685c04e18fc779fea73f7cb37032cc29d89cf19 Mon Sep 17 00:00:00 2001 From: Ludwig Schwardt Date: Mon, 19 Oct 2020 16:56:36 +0200 Subject: [PATCH] Clean up pylint errors via config options The majority of pylint gripes are related to Astropy modules with dynamically generated attributes (units and constants) and short and quirky variable names (a, b, c, P1). Disable these to get a respectable pylint score :-) Also document the max line length in case we want to change it one day. The alternative to setup.cfg would have been the newer and shinier pyproject.toml. Both these files support pylint options these days, which is preferable to the old .pylintrc which just clutters up the directory. Prefer setup.cfg for now since flake8 does not support the newer file (https://gitlab.com/pycqa/flake8/-/issues/428). --- setup.cfg | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.cfg b/setup.cfg index 3363390..b282425 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,3 +3,15 @@ universal = 1 [flake8] max-line-length = 120 + +[pylint.MESSAGES CONTROL] +# Katpoint has many short and quirky variable names - leave it for now +disable = invalid-name + +[pylint.TYPECHECK] +# These Astropy modules generate most of their members +ignored-modules = astropy.units,astropy.constants + +[pylint.FORMAT] +# The default is 120, but put it in here for visibility if we want to change it +max-line-length = 120