Skip to content

Commit

Permalink
Update github actions to use ruff instead of flake8 and pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
jongbinjung committed Oct 11, 2024
1 parent ba360aa commit c14d1a6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 12 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/coverage-lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,28 @@ jobs:
pip install --upgrade pip setuptools wheel
pip install .[test]
- name: Lint
run: flake8 src/h3 tests
- name: Install CLI Reviewdog
uses: reviewdog/action-setup@v1

# Order is important for these commands
# Run the actual fixes first so that they are picked up by next GH step but
# removed from the final run of the linter.
# Second run of the linter will report unfixable issues via reviewdog
- name: Run Linting
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ruff format .
ruff check . --fix-only
ruff check . | reviewdog -efm="%f:%l:%c: %m" -reporter=github-pr-review -level=warning
- name: Pylint
# As a test for visibility of API bindings, we want to ensure that pylint has no
# `import-error` warnings for h3 imports.
run: pylint --disable=all --enable=import-error tests/
# Picks up file changes from the previous action
- name: Suggest Fixes
uses: reviewdog/action-suggester@v1
with:
tool_name: ruff
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning

- name: Coverage
run: |
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/coverage-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,28 @@ jobs:
pip install --upgrade pip setuptools wheel
pip install .[test]
- name: Lint
run: flake8 src/h3 tests
- name: Install CLI Reviewdog
uses: reviewdog/action-setup@v1

# Order is important for these commands
# Run the actual fixes first so that they are picked up by next GH step but
# removed from the final run of the linter.
# Second run of the linter will report unfixable issues via reviewdog
- name: Run Linting
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ruff format .
ruff check . --fix-only
ruff check . | reviewdog -efm="%f:%l:%c: %m" -reporter=github-pr-review -level=warning
- name: Pylint
# As a test for visibility of API bindings, we want to ensure that pylint has no
# `import-error` warnings for h3 imports.
run: pylint --disable=all --enable=import-error tests/
# Picks up file changes from the previous action
- name: Suggest Fixes
uses: reviewdog/action-suggester@v1
with:
tool_name: ruff
github_token: ${{ secrets.GITHUB_TOKEN }}
level: warning

- name: Coverage
run: |
Expand Down

0 comments on commit c14d1a6

Please sign in to comment.