mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
Enable ALL Ruff rules set by default (#2775)
* style: use Ruff default linter rules * ci: check linter files over changed ones
This commit is contained in:
25
.github/workflows/linter.yml
vendored
25
.github/workflows/linter.yml
vendored
@@ -5,12 +5,29 @@ on: [pull_request]
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Requirements
|
- name: Fetch Target Branch
|
||||||
|
run: git fetch origin $TARGET_BRANCH --depth=1
|
||||||
|
|
||||||
|
- name: Install Ruff
|
||||||
|
run: pip install ruff
|
||||||
|
|
||||||
|
- name: Get Changed Python Files
|
||||||
|
id: changed-files
|
||||||
run: |
|
run: |
|
||||||
pip install ruff
|
merge_base=$(git merge-base origin/"$TARGET_BRANCH" HEAD)
|
||||||
|
changed_files=$(git diff --name-only --diff-filter=ACMRTUB "$merge_base" | grep '\.py$' || true)
|
||||||
|
echo "files<<EOF" >> $GITHUB_OUTPUT
|
||||||
|
echo "$changed_files" >> $GITHUB_OUTPUT
|
||||||
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Run Ruff Linter
|
- name: Run Ruff on Changed Files
|
||||||
run: ruff check
|
if: ${{ steps.changed-files.outputs.files != '' }}
|
||||||
|
run: |
|
||||||
|
echo "${{ steps.changed-files.outputs.files }}" | tr " " "\n" | xargs -I{} ruff check "{}"
|
||||||
|
|||||||
@@ -2,8 +2,3 @@ exclude = [
|
|||||||
"templates",
|
"templates",
|
||||||
"__init__.py",
|
"__init__.py",
|
||||||
]
|
]
|
||||||
|
|
||||||
[lint]
|
|
||||||
select = [
|
|
||||||
"I", # isort rules
|
|
||||||
]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user