SMILER icon indicating copy to clipboard operation
SMILER copied to clipboard

Integrate a Python linter into tests

Open tkunic opened this issue 3 years ago • 1 comments

Background

Ideally, PR reviewers don't waste time calling out style issues and don't have to perform any manual testing to validate that PRs are sound. These things should be automated via bots and scripts (also see https://github.com/TsotsosLab/SMILER/issues/30).

To help this along, consider integrating a linter, a style checker, and/or a formatter into the CI/testing process to catch bugs and help keep the code stay readable.

Some common Python tools used for this include:

  • linters: pylint, flake8
  • formatters: black, yapf

Acceptance Criteria

  • Integrate a linter and formatter into the SMILER developer workflow so it can be easily called by developers and CI tools.

tkunic avatar Feb 13 '22 17:02 tkunic

I've integrated a linter into a branch on my fork of SMILER. When I run it, it brings up a ton of assorted formatting problems in the code. Do we want to be running pylint on all of SMILER, or only some subset of the code? It would be possible to integrate a formatter as well or go in and start manually changing things, but I'm not sure if parts of the code should remain unchanged.

f-wright avatar Feb 26 '22 00:02 f-wright