Setup pre-commit config
I propose to add a https://pre-commit.com/ config to this repository to add code formatting/cleaning and few checks to keep the files in check.
Here is a config draft I propose:
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: destroyed-symlinks
- id: check-json
- id: check-yaml
- id: check-xml
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
hooks:
- id: prettier
files: \.(md|yml|yaml)$
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args:
- --builtin=clear,rare,informal
This would also mean to add a CI job to enforce those checks.
Personally it would make it easier for me to edit files using a IDE that automatically format and clean on save (which I consider a good practice), and prevent some spelling error to land in the code.