mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* ci/lint: fix calling Ruff's format * Transition for ruff lint. Only checking the modified files. --------- Co-authored-by: ifuryst <ifuryst@gmail.com>
53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint-frontend:
|
|
name: Lint frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd frontend
|
|
npm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: |
|
|
cd frontend
|
|
npm run lint
|
|
|
|
lint-python:
|
|
name: Lint python
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.11
|
|
cache: 'pip'
|
|
- name: Install pre-commit
|
|
run: pip install pre-commit==3.7.0
|
|
- name: Run pre-commit hooks
|
|
run: |
|
|
git fetch https://github.com/OpenDevin/OpenDevin.git main:main && \
|
|
pre-commit run \
|
|
--files \
|
|
$(git diff --name-only $(git merge-base main $(git branch --show-current)) $(git branch --show-current) | tr '\n' ' ') \
|
|
--show-diff-on-failure \
|
|
--config ./dev_config/python/.pre-commit-config.yaml
|