From cc2a496f904331294eae481db2e13574c45a05be Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Thu, 18 Jul 2024 11:01:02 -0700 Subject: [PATCH] Setup pre-commit so it runs locally before every git push (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Setup pre-commit so it runs locally before every git push * Update .pre-commit-config.yaml * added more checks * update readme * Apply suggestions from code review Co-authored-by: José Ulises Niño Rivera * remove cargo-check --------- Co-authored-by: José Ulises Niño Rivera --- .pre-commit-config.yaml | 24 ++++++++++++++++++++++++ README.md | 10 ++++++++++ gateway.code-workspace | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..eb5b0a78 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: local + hooks: + - id: cargo-fmt + name: cargo-fmt + language: system + types: [file, rust] + entry: bash -c "cd envoyfilter && cargo fmt --all" + - id: cargo-clippy + name: cargo-clippy + language: system + types: [file, rust] + entry: bash -c "cd envoyfilter && cargo clippy --all" + - id: cargo-test + name: cargo-test + language: system + types: [file, rust] + entry: bash -c "cd envoyfilter && cargo test --all" diff --git a/README.md b/README.md index d3644c91..26c6a726 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ A open source project for developers to build and secure faster, more personalized generative AI apps. Katanemo is a high performance gateway designed with state of the art (SOTA) fast LLMs to process, route and evaluate prompts. + +# Dev setup + +## Pre-commit +Use instructions at [pre-commit.com](https://pre-commit.com/#install) to set it up for your machine. Once installed make sure github hooks are setup, so that when you upstream your change pre-commit hooks can run and validate your change. Follow command below to setup github hooks, + +```sh +➜ intelligent-prompt-gateway git:(main) ✗ pre-commit install +pre-commit installed at .git/hooks/pre-commit +``` diff --git a/gateway.code-workspace b/gateway.code-workspace index b9cf62c5..98d02f91 100644 --- a/gateway.code-workspace +++ b/gateway.code-workspace @@ -14,4 +14,4 @@ }, ], "settings": {} -} \ No newline at end of file +}