cosanlab / nltools

Python toolbox for analyzing imaging data
https://nltools.org
MIT License
120 stars 42 forks source link

Think about standardizing code-formatting for all contributions? #343

Closed ejolly closed 1 year ago

ejolly commented 4 years ago

@ljchang One issue that's a bit annoying is we haven't enforced a particular code-formatting style for the library. We very loosely adhere to pycodestyle, but it's not consistent across the library. This obviously doesn't change functionality but a few reasons to do this are:

A popular option that is used in several other libraries and one I use myself for other projects is black. It's very simple to use (no configuration), adheres to PEP 8, and can very simply format an entire file within your editor with a single shortcut.

I thought I had introduced a commit in an old PR that reformatted the entire library for everyone, but looks like it got overwritten in one of your or someone else's PRs. I had to refork the entire library as a result of this because I couldn't make sense of what changes were happening where.

If we go with this, then we can add a "how to contribute" page so future PRs know to format their contributions.