mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
chore: add import lint to CI
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
9cf2b2b231
commit
80f39963f1
4
.github/workflows/style.yml
vendored
4
.github/workflows/style.yml
vendored
@ -43,6 +43,10 @@ jobs:
|
|||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
run: uv sync --project api --dev
|
run: uv sync --project api --dev
|
||||||
|
|
||||||
|
- name: Run Import Linter
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
run: uv run --directory api --dev lint-imports
|
||||||
|
|
||||||
- name: Run Basedpyright Checks
|
- name: Run Basedpyright Checks
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
run: dev/basedpyright-check
|
run: dev/basedpyright-check
|
||||||
|
|||||||
@ -22,14 +22,15 @@ containers =
|
|||||||
ignore_imports =
|
ignore_imports =
|
||||||
core.workflow.nodes.base.node -> core.workflow.graph_events
|
core.workflow.nodes.base.node -> core.workflow.graph_events
|
||||||
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph_events
|
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph_events
|
||||||
|
core.workflow.nodes.loop.loop_node -> core.workflow.graph_events
|
||||||
|
|
||||||
|
core.workflow.nodes.node_factory -> core.workflow.graph
|
||||||
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph_engine
|
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph_engine
|
||||||
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph
|
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph
|
||||||
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph_engine.command_channels
|
core.workflow.nodes.iteration.iteration_node -> core.workflow.graph_engine.command_channels
|
||||||
core.workflow.nodes.loop.loop_node -> core.workflow.graph_events
|
|
||||||
core.workflow.nodes.loop.loop_node -> core.workflow.graph_engine
|
core.workflow.nodes.loop.loop_node -> core.workflow.graph_engine
|
||||||
core.workflow.nodes.loop.loop_node -> core.workflow.graph
|
core.workflow.nodes.loop.loop_node -> core.workflow.graph
|
||||||
core.workflow.nodes.loop.loop_node -> core.workflow.graph_engine.command_channels
|
core.workflow.nodes.loop.loop_node -> core.workflow.graph_engine.command_channels
|
||||||
core.workflow.nodes.node_factory -> core.workflow.graph
|
|
||||||
|
|
||||||
[importlinter:contract:rsc]
|
[importlinter:contract:rsc]
|
||||||
name = RSC
|
name = RSC
|
||||||
@ -59,7 +60,7 @@ layers =
|
|||||||
event_management
|
event_management
|
||||||
error_handling
|
error_handling
|
||||||
graph_traversal
|
graph_traversal
|
||||||
state_management
|
graph_state_manager
|
||||||
worker_management
|
worker_management
|
||||||
domain
|
domain
|
||||||
containers =
|
containers =
|
||||||
@ -86,14 +87,6 @@ forbidden_modules =
|
|||||||
core.workflow.graph_engine.command_processing
|
core.workflow.graph_engine.command_processing
|
||||||
core.workflow.graph_engine.event_management
|
core.workflow.graph_engine.event_management
|
||||||
|
|
||||||
[importlinter:contract:error-handling-strategies]
|
|
||||||
name = Error Handling Strategies
|
|
||||||
type = independence
|
|
||||||
modules =
|
|
||||||
core.workflow.graph_engine.error_handling.abort_strategy
|
|
||||||
core.workflow.graph_engine.error_handling.retry_strategy
|
|
||||||
core.workflow.graph_engine.error_handling.fail_branch_strategy
|
|
||||||
core.workflow.graph_engine.error_handling.default_value_strategy
|
|
||||||
|
|
||||||
[importlinter:contract:graph-traversal-components]
|
[importlinter:contract:graph-traversal-components]
|
||||||
name = Graph Traversal Components
|
name = Graph Traversal Components
|
||||||
|
|||||||
@ -5,6 +5,9 @@ set -x
|
|||||||
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||||
cd "$SCRIPT_DIR/.."
|
cd "$SCRIPT_DIR/.."
|
||||||
|
|
||||||
|
# Import linter
|
||||||
|
uv run --directory api --dev lint-imports
|
||||||
|
|
||||||
# run ruff linter
|
# run ruff linter
|
||||||
uv run --directory api --dev ruff check --fix ./
|
uv run --directory api --dev ruff check --fix ./
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user