Include Black
Hey guys, what do you think about including a formatter like Black - to keep the code consistent?
I've seen in many places that different coding styles were used, so it is a good idea to add a formatter so the code would be much better to read. We can do it in two ways:
- format all files at once and just merge it
- format only these files which were edited by "new" team (step by step)
Additionally this would required adding a step during GH Actions
Also, we could maybe add templates for PRs and Issues to standardize it.
In my opinion, to make development and contributions easier, a code formatter should be used anyway. And I am also leaning towards Black, it really works great.
I will open a PR with such changes, please let me know if that is not welcomed ?!
GH actions could enforce such formatting, but what about using pre-commit to clean code on the developer side ?
Maybe formatting all the code at once is better, to prevent any future formatting commit/changes mixing with real changes.
@JAugusto42 is currently going through the files one by one, cleaning them up and making them conform to PEP-8, I'm sure you could co-ordinate with him to see where he's at on this effort.
I'd rather not have one big PR with all the changes from an automatic formatter. The code is extremely messy, and such a PR would be massive and really hard to review.
what I was thinking is that we would have some kind of linter run as a test on Pull Request, that would flag changes that were necessary. I'm not a big fan of automatic code formatting.
Regarding pre-commit, do we agree on the idea of having such tool ? Whether someone wants to use it, is totally up to him.
I am unsure of where to start regarding adding any new formatter/linter tool. Should I attach any additional tool to pytest ? Does this project already have some kind of centralized task manager/development utility ?
The problem with using a tool is that as soon as one person uses a code formatting tool on pre-commit, everyone has to use it, otherwise, you'll be altering other people's code every time you commit, and I'm not really comfortable with that. I honestly haven't done enough research on Black, or Flake8, which is the other tool I'm considering, to look at the upsides and downsides.
We don't have a specific tool for task, or project management. In the rare instances where co-ordination is necessary, we use gitter and chat through stuff there. You could co-ordinate with Jose there and see what he's up to.
If there is a big push for it we could set up the Github Projects page, but currently it's mainly me doing all the development, and reviewing the PRs, so there hasn't really been the need for it.
From what I've seen from other projects, some do use pre-commit hooks, but most usually apply the styling step on CI, that way quality checks are ensured. By the way, while we're putting suggestions, maybe ruff would be a good tool for linting the code?