Skip to content

armgit / storm

Public Imported from GitHub
0

An LLM-powered knowledge curation system that researches a topic and generates a full-length report with citations.

Add pre-commit hook.

shaoyijiab5ce5935d34f
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..9cca527
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,10 @@
+repos:
+ - repo: https://github.com/psf/black
+ rev: 24.8.0
+ hooks:
+ - id: black
+ name: Format Python code with black
+ entry: black
+ args: ["knowledge_storm/"]
+ language: python
+ pass_filenames: true
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8fd7f0d..76a8823 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -40,9 +40,9 @@ Following the suggested format can lead to a faster review process.
**Code Format:**
-We adopt [`black`](https://github.com/psf/black) for arranging and formatting Python code. Please complete the following step before submitting the PR. See [here](https://github.com/psf/black?tab=readme-ov-file#installation-and-usage) for more information.
-```shell
-pip install black
-black {path_to_the_changed_python_code}
+We adopt [`black`](https://github.com/psf/black) for arranging and formatting Python code. To streamline the contribution process, we set up a [pre-commit hook](https://pre-commit.com/) to format the code under `knowledge_storm/` before committing. To install the pre-commit hook, run:
```
-
+pip install pre-commit
+pre-commit install
+```
+The hook will automatically format the code before each commit.