Skip to content
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

send linting hints to comment when style check fails #3881

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
python-style:
name: Python Style
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Checkout code
Expand All @@ -29,12 +30,26 @@ jobs:
- name: Ruff check
run: ruff check ./api

- name: Ruff hints
if: failure()
# uses: thollander/actions-comment-pull-request@v2
# with:
# message: |
# Please run 'dev/reformat' to fix the fixable linting errors.
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Please run 'dev/reformat' to fix the fixable linting errors."
})

- name: Dotenv check
run: dotenv-linter ./api/.env.example ./web/.env.example

- name: Lint hints
if: failure()
run: echo "Please run 'dev/reformat' to fix the fixable linting errors."

test:
name: ESLint and SuperLinter
Expand Down
2 changes: 1 addition & 1 deletion api/core/rag/datasource/vdb/milvus/milvus_vector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from typing import Any, Optional
from uuid import uuid4
from typing import Any, Optional

from pydantic import BaseModel, root_validator
from pymilvus import MilvusClient, MilvusException, connections
Expand Down