-
Notifications
You must be signed in to change notification settings - Fork 5
Prepare project config for Text2Gremlin #76
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -163,6 +163,9 @@ addopts = "--strict-markers --strict-config" | |
| [tool.ruff] | ||
| line-length = 120 | ||
| target-version = "py310" | ||
| extend-exclude = [ | ||
| "text2gremlin/AST_Text2Gremlin/base/gremlin/*.py", | ||
| ] | ||
|
|
||
| [tool.ruff.lint] | ||
| # Select a broad set of rules for comprehensive checks. | ||
|
|
@@ -188,6 +191,30 @@ ignore = [ | |
| "tests/**/*.py" = ["T20"] | ||
| "hugegraph-ml/src/hugegraph_ml/examples/**/*.py" = ["T20"] | ||
| "hugegraph-python-client/src/pyhugegraph/structure/*.py" = ["N802"] | ||
| "text2gremlin/AST_Text2Gremlin/base/*.py" = [ | ||
| "N999", # Keep existing standalone module names such as GremlinBase.py. | ||
| ] | ||
| "text2gremlin/AST_Text2Gremlin/analyze_syntax.py" = ["T20"] | ||
| "text2gremlin/AST_Text2Gremlin/generate_corpus.py" = ["T20"] | ||
| "text2gremlin/AST_Text2Gremlin/run_llm_pipeline.py" = ["T20"] | ||
| "text2gremlin/AST_Text2Gremlin/base/GremlinBase.py" = ["T20"] | ||
| "text2gremlin/AST_Text2Gremlin/base/GremlinTransVisitor.py" = [ | ||
| "F403", # ANTLR visitor compatibility import style. | ||
| "F811", # Visitor methods mirror grammar alternatives and may intentionally repeat names. | ||
| "T20", # Parser diagnostics are printed by the standalone visitor helper. | ||
| ] | ||
|
Comment on lines
+201
to
+205
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. In Python, defining multiple methods with the same name within a class will silently overwrite the previous definitions (as Python does not support method overloading). If the upcoming
Collaborator
Author
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. Not changing this in PR1. This PR only prepares project plumbing and does not include |
||
| "text2gremlin/AST_Text2Gremlin/base/TraversalGenerator.py" = [ | ||
| "E501", # Long generated traversal fragments are kept readable. | ||
| "E741", # Gremlin examples may use compact variable names in local comprehensions. | ||
| "RUF012", # Class-level step configuration dictionaries are constants in practice. | ||
| "SIM102", # Keep complex traversal-generation branching explicit. | ||
| "SIM108", # Keep complex traversal-generation branching explicit. | ||
| ] | ||
| "text2gremlin/AST_Text2Gremlin/llm_augment/*.py" = [ | ||
| "E501", # Long prompts are kept readable. | ||
| "RUF002", # Chinese prompt text intentionally uses full-width punctuation. | ||
| "T20", # Standalone data-generation scripts write progress to stdout. | ||
| ] | ||
|
|
||
| [tool.ruff.lint.isort] | ||
| known-first-party = ["hugegraph_llm", "hugegraph_python_client", "hugegraph_ml", "vermeer_python_client"] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # 配置文件 | ||
| config.json | ||
| .env | ||
| output/ | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| *.so | ||
| .Python | ||
| *.egg-info/ | ||
| .eggs/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| antlr4-python3-runtime==4.13.1 | ||
| openai~=1.61.0 | ||
| pandas~=2.2.3 | ||
| pydantic~=2.10.6 | ||
| pytest~=8.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP 8 recommends using short, all-lowercase names for modules and packages, with underscores only if they improve readability (e.g.,
ast_text2gremlin,gremlin_base.py,gremlin_trans_visitor.py,traversal_generator.py).\n\nSince this is a brand new feature being introduced to the repository, it is highly recommended to rename these directories and files to follow standard snake_case naming conventions. This will improve maintainability, align with the rest of the codebase, and eliminate the need for suppressingN999(invalid module name) lint errors.References
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not changing this in PR1. Renaming
AST_Text2Gremlinand the existing visitor/generator modules would affect imports, docs, and follow-up split PR boundaries. This series is intentionally splitting the existing implementation for review without doing a broad rename/refactor; naming cleanup can be handled as a separate follow-up if maintainers want it.