From 333278fd815d3261daf157eb099098c95864fe26 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 28 Nov 2024 15:29:29 +0100 Subject: [PATCH] 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 --- .pre-commit-config.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000000..fe1a13e4c102 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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"