-
Notifications
You must be signed in to change notification settings - Fork 64
feat: add ruff lint & pre-commit #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
54e0c99
Support auto-pr-comment
imbajin 85cd8c7
Merge remote-tracking branch 'upstream/main'
imbajin cb297dc
Merge remote-tracking branch 'upstream/main'
imbajin 5962938
Merge remote-tracking branch 'upstream/main'
imbajin 8280589
Merge remote-tracking branch 'upstream/main'
imbajin d6c472d
Merge remote-tracking branch 'upstream/main'
imbajin ea2efda
add basic
fantasy-lotus 8c7fed1
Merge branch 'apache:main' into main
fantasy-lotus 602c2ee
Merge branch 'apache:main' into main
fantasy-lotus 08da949
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user c82a4a2
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user cfbcbd0
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user d458f5a
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user d174eee
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user 44035df
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user b0d7ff5
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user de99cae
Merge branch 'main' of https://github.com/apache/incubator-hugegraph-ai
actions-user dc863d8
feat ruff rule
fantasy-lotus f17161f
ruff auto lint
fantasy-lotus 0f0f316
rm unused file
fantasy-lotus d5b8520
fix
fantasy-lotus 4daf552
add ruff ci & rm black
fantasy-lotus 8575b49
fix ruff & add ignore
fantasy-lotus 719e319
fix
fantasy-lotus 573f80e
fix
fantasy-lotus 763fc02
fix
fantasy-lotus 3fbc7f1
fix
fantasy-lotus 33c0eaf
feat: add pre-commit configuration
fantasy-lotus d14deea
fix
fantasy-lotus 64846fe
fix
fantasy-lotus 0403c62
add ruff & pre-commit readme
fantasy-lotus 67136d3
feat(llm): add basic unit-test for llm module (#311)
weijinglin f2e6971
fix
fantasy-lotus 58984e3
Merge upstream/main into feat/add-ruff-mypy with ours strategy
fantasy-lotus 9eebbbb
Apply suggestions from code review
imbajin a7f88b2
chore: refactor string formatting and type hints across codebase
imbajin 8f75ebb
Suppress unused variable warnings in BGNN and PGNN
imbajin c424dbf
Update README.md
imbajin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.6.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-yaml | ||
| - id: check-added-large-files | ||
| args: ["--maxkb=1000"] | ||
| - id: check-merge-conflict | ||
| - id: check-case-conflict | ||
| - id: check-docstring-first | ||
| - id: debug-statements | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.13.1 | ||
| hooks: | ||
imbajin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - id: ruff-format | ||
| types_or: [python, pyi] | ||
| - id: ruff | ||
| types_or: [python, pyi] | ||
| args: [--fix] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| Apache HugeGraph (incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. | ||
|
|
||
| Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, | ||
| Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, | ||
| and decision making process have stabilized in a manner consistent with other successful ASF projects. | ||
|
|
||
| While incubation status is not necessarily a reflection of the completeness or stability of the code, | ||
| While incubation status is not necessarily a reflection of the completeness or stability of the code, | ||
| it does indicate that the project has yet to be fully endorsed by the ASF. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,4 +48,4 @@ services: | |
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 | ||
| start_period: 60s | ||
| start_period: 60s | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,16 @@ For detailed source code doc, visit our [DeepWiki](https://deepwiki.com/apache/i | |
| > - **HugeGraph Server**: 1.3+ (recommended: 1.5+) | ||
| > - **UV Package Manager**: 0.7+ | ||
|
|
||
| ### Code Quality (ruff + pre-commit) | ||
|
|
||
| - Ruff is used for linting and formatting: | ||
| - `ruff format .` | ||
| - `ruff check .` | ||
| - Enable Git hooks via pre-commit: | ||
| - `pre-commit install` (in the root dir) | ||
| - `pre-commit run --all-files` | ||
| - Config: [../.pre-commit-config.yaml](../.pre-commit-config.yaml) | ||
|
|
||
| ## 🚀 Quick Start | ||
|
|
||
| Choose your preferred deployment method: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 配置文件位于项目根目录 建议:
|
||
|
|
@@ -177,7 +187,7 @@ The system supports both English and Chinese prompts. To switch languages: | |
|
|
||
| If you previously used high-level classes like `RAGPipeline` or `KgBuilder`, the project now exposes stable flows through the `Scheduler` API. Use `SchedulerSingleton.get_instance().schedule_flow(...)` to invoke workflows programmatically. Below are concise, working examples that match the new architecture. | ||
|
|
||
| 1) RAG (graph-only) query example | ||
| 1. RAG (graph-only) query example | ||
|
|
||
| ```python | ||
| from hugegraph_llm.flows.scheduler import SchedulerSingleton | ||
|
|
@@ -196,7 +206,7 @@ res = scheduler.schedule_flow( | |
| print(res.get("graph_only_answer")) | ||
| ``` | ||
|
|
||
| 2) RAG (vector-only) query example | ||
| 2. RAG (vector-only) query example | ||
|
|
||
| ```python | ||
| from hugegraph_llm.flows.scheduler import SchedulerSingleton | ||
|
|
@@ -212,7 +222,7 @@ res = scheduler.schedule_flow( | |
| print(res.get("vector_only_answer")) | ||
| ``` | ||
|
|
||
| 3) Text -> Gremlin (text2gremlin) example | ||
| 3. Text -> Gremlin (text2gremlin) example | ||
|
|
||
| ```python | ||
| from hugegraph_llm.flows.scheduler import SchedulerSingleton | ||
|
|
@@ -230,7 +240,7 @@ response = scheduler.schedule_flow( | |
| print(response.get("template_gremlin")) | ||
| ``` | ||
|
|
||
| 4) Build example index (used by text2gremlin examples) | ||
| 4. Build example index (used by text2gremlin examples) | ||
|
|
||
| ```python | ||
| from hugegraph_llm.flows.scheduler import SchedulerSingleton | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.