From 206985018ec8bcb3a82f519cb3127fd188aef60d Mon Sep 17 00:00:00 2001 From: Pilmo Kim Date: Mon, 23 Sep 2024 00:35:24 +0900 Subject: [PATCH 1/3] add pre-commit yaml --- .pre-commit-config.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 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 00000000..8fd3f3ac --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/doublify/pre-commit-rust + rev: v1.0 + hooks: + - id: fmt + name: Running "cargo fmt" + description: Format files with cargo fmt. + - id: clippy + name: Running "cargo clippy" + description: Lint rust sources + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.7 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format From 2d7e8bc479ff48ccb929e418c6f7abc444adc980 Mon Sep 17 00:00:00 2001 From: Gyubong Date: Sun, 29 Sep 2024 11:26:20 +0900 Subject: [PATCH 2/3] lint --- raftify/src/raft_node/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/raftify/src/raft_node/mod.rs b/raftify/src/raft_node/mod.rs index 62bb9426..b318943d 100644 --- a/raftify/src/raft_node/mod.rs +++ b/raftify/src/raft_node/mod.rs @@ -1147,6 +1147,7 @@ impl< tx_msg .send(LocalResponseMsg::GetRawNode { raw_node: Arc::new(Mutex::new(unsafe { + #[allow(clippy::missing_transmute_annotations)] std::mem::transmute(&self.raw_node) })), }) From a59e00eafdfe8270aa1347202db08071ff293815 Mon Sep 17 00:00:00 2001 From: Gyubong Date: Sun, 29 Sep 2024 11:32:00 +0900 Subject: [PATCH 3/3] docs: Update DEVELOPMENT.md --- DEVELOPMENT.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 47fb7a13..8f8b96da 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -5,3 +5,21 @@ You can use this command to clone the repository: ``` ❯ git clone --recursive https://github.com/lablup/raftify.git ``` + +If you already cloned it and forgot to initialize the submodules, execute the following command: + +``` +❯ git submodule update --init +``` + +# Development environment setup + +## precommit hook setup + +You can use pre-commit hooks with the following configuration. +This commit hook performs checks like cargo fmt and cargo clippy before committing. + +``` +❯ pip install pre-commit --break-system-packages +❯ pre-commit install +```