chore: Add a simple pre-commit config

By limiting the commits that we look at to the changes since `master` we
can incrementally pull files under the coverage of these lints and checks.

Changelog-None: Not applicable, this is DX
This commit is contained in:
Christian Decker
2024-11-28 15:29:29 +01:00
committed by Rusty Russell
parent 0dee58ca56
commit f38cc0e897

13
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.0
hooks:
# Run the linter.
- id: ruff
args: [ --diff ]
exclude: "contrib/pyln-grpc-proto/pyln/grpc/(primitives|node)_pb2(|_grpc).py"
# Run the formatter.
- id: ruff-format
args: [ --diff ]
exclude: "contrib/pyln-grpc-proto/pyln/grpc/(primitives|node)_pb2(|_grpc).py"