cnellington / Contextualized

An SKLearn-style toolbox for estimating and analyzing models, distributions, and functions with context-specific parameters.
http://contextualized.ml/
GNU General Public License v3.0
65 stars 9 forks source link

Fix some pylint issues with Black. #111

Closed blengerich closed 2 years ago

blengerich commented 2 years ago

A PR to document the process of fixing pylint issues with Black, and contribute a few small changes to raise the pylint score from 4.11 to 4.14.

My workflow:

  1. pylint-badge contextualized pylint.svg calculates the current pylint score.
  2. black --check contextualized --target-version=py37 gives a list of files to be updated by black.
  3. Picking a particular filefoo.py from the list above, I run black contextualized/foo.py --target-version=py37. This makes formatting changes to align with the Black style.
  4. Manually inspect the changes with git diff contextualized/foo.py.
  5. Re-run pylint-badge contextualized pyling.svg to re-calculate the pylint score, and re-create a badge with that score. Sanity check that pylint score did not decrease by making style changes with black.

Currently, black also suggests a number of changes to files which are being modified, and close to merging, in other branches. This PR should not include any of those files.