Laboratoire-de-Chemoinformatique / Synt-On

Open-source tool for synthons-based library design.
BSD 3-Clause "New" or "Revised" License
64 stars 23 forks source link

Reformat code with black #7

Open cthoyt opened 2 years ago

cthoyt commented 2 years ago

Hi, thanks for making your code open source. There are a couple issues I had with reading through, understanding it, and installing it. One of the big problems was the formatting was very non-standard. Consider that the code for academic work is itself like the methods section of a paper, and it is indeed meant to be read and understood.

This pull request uses standard tooling for making the first major steps towards making the code more readable (and also therefore more maintainable). More specifically, this PR does the following:

  1. Creates a tox.ini configuration file that's a recipe for auto-formatting the code with black and isort. It can be run with first pip install tox, then running tox in the command line
  2. Adds instructions to the README.md how to use the tox file to apply auto-formatting
  3. Applies auto-formatting using this command
  4. Sets up a continuous integration with GitHub actions (lint.yml) so every time a push is made, it checks that the linting was applied properly.