django-unicorn icon indicating copy to clipboard operation
django-unicorn copied to clipboard

Add `pre-commit`

Open adamghill opened this issue 1 year ago • 1 comments

Add configuration for pre-commit.

  • Should include ruff and potentially mypy checks (if it doesn't slow things down too much) -- look at
  • Should this only run on commits to main?
  • Add setup steps to new CONTRIBUTING.md doc (WIP)

adamghill avatar Jun 28 '24 14:06 adamghill

I spotted a failing Dependabot issue for Black that was created back in March, which can be a problem for pre-commit:

Sadly, Dependabot does not support pre-commit (nor will it anytime soon). To keep hooks and Python packages in sync, you must manually track hook updates by running pre-commit autoupdate regularly.

A mismatch between the Black Python package and pre-commit hook versions can lead to wrongly formatted code. Similar issues can occur with other quality tools.

I don't have a practical solution for this situation, but it is something to consider.

Cc. @epw1624 (we discovered this during a Zoom call)

MHLut avatar Jul 04 '24 15:07 MHLut