From 0e273c3f449abc7af1f3095e5e1250ec91556f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex?= Date: Thu, 12 Dec 2024 12:13:24 +0100 Subject: [PATCH] ci(pre-commit): config and docs (#942) --- .pre-commit-config.yaml | 7 +++++++ CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 CONTRIBUTING.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..2e7b85bc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt + - id: clippy + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..fecc5e11 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing to Nomos Node + +We're glad you're interested in contributing to Nomos Node! + +This document describes the guidelines for contributing to the project. We will be updating it as we grow and we figure +out what works best for us. + +If you have any questions, come say hi to our [Discord](https://discord.gg/G6q8FgZq)! + +## Running Pre-Commit Hooks + +To ensure consistent code quality, we ask that you run the `pre-commit` hooks before making a commit. + +These hooks help catch common issues early and applies common code style rules, making the review process smoother for +everyone. + +1. Install the [pre-commit](https://pre-commit.com/) tool if you haven't already: + +```bash +# On Fedora +sudo dnf install pre-commit + +# On other systems +pip install pre-commit +``` + +2. Install the pre-commit hooks: + +```bash +pre-commit install +``` + +3. That's it! The pre-commit hooks will now run automatically when you make a commit.