urinieto / msaf

Music Structure Analysis Framework
MIT License
501 stars 79 forks source link

Add pre-commit config #155

Closed carlthome closed 10 months ago

carlthome commented 10 months ago

This is just small a suggestion. I perfectly understand if you don't think this is worth the hassle, but whenever I try to bug fix in MSAF I have to think a bit extra about how to format whitespace, etc. and would prefer if there was some typical automagic setup that just did the standard thing for me.

Since arguably black is the new default code formatter for Python these days, and pre-commit is having a strong foothold (example, example, etc.), perhaps those tools could be applied on MSAF as well?

Pros:

  1. Easier to contribute without having to think about code formatting so much ("just run black") so we can focus on numerical stuff
  2. Automatic early code review by catching style and flake errors on CI

Cons:

  1. One more step and tool to learn in order to contribute
  2. Might make code look uglier after the automatic formatting sometimes

Again, totally get if you think this is not worth the hassle! Just wanted to propose it to see how it feels! :D

urinieto commented 10 months ago

Oh, I've been using black+pre-commits for quite some time now, and I love it. Yes, let's do this! Thank you!