mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
ci/lint: fix calling Ruff's format (#1457)
* ci/lint: fix calling Ruff's format * Transition for ruff lint. Only checking the modified files. --------- Co-authored-by: ifuryst <ifuryst@gmail.com>
This commit is contained in:
parent
cfef3ee5c4
commit
1b810cfbf0
6
.github/workflows/lint.yml
vendored
6
.github/workflows/lint.yml
vendored
@ -33,6 +33,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
- name: Set up python
|
- name: Set up python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
@ -42,7 +44,9 @@ jobs:
|
|||||||
run: pip install pre-commit==3.7.0
|
run: pip install pre-commit==3.7.0
|
||||||
- name: Run pre-commit hooks
|
- name: Run pre-commit hooks
|
||||||
run: |
|
run: |
|
||||||
|
git fetch https://github.com/OpenDevin/OpenDevin.git main:main && \
|
||||||
pre-commit run \
|
pre-commit run \
|
||||||
--all-files \
|
--files \
|
||||||
|
$(git diff --name-only $(git merge-base main $(git branch --show-current)) $(git branch --show-current) | tr '\n' ' ') \
|
||||||
--show-diff-on-failure \
|
--show-diff-on-failure \
|
||||||
--config ./dev_config/python/.pre-commit-config.yaml
|
--config ./dev_config/python/.pre-commit-config.yaml
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -150,7 +150,7 @@ install-precommit-hooks:
|
|||||||
|
|
||||||
lint:
|
lint:
|
||||||
@echo "$(YELLOW)Running linters...$(RESET)"
|
@echo "$(YELLOW)Running linters...$(RESET)"
|
||||||
@poetry run pre-commit run --all-files --show-diff-on-failure --config $(PRECOMMIT_CONFIG_PATH)
|
@poetry run 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 $(PRECOMMIT_CONFIG_PATH)
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
@echo "$(YELLOW)Building frontend...$(RESET)"
|
@echo "$(YELLOW)Building frontend...$(RESET)"
|
||||||
|
|||||||
@ -20,16 +20,16 @@ repos:
|
|||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
# Ruff version.
|
# Ruff version.
|
||||||
rev: v0.3.7
|
rev: v0.4.1
|
||||||
hooks:
|
hooks:
|
||||||
# Run the linter.
|
# Run the linter.
|
||||||
- id: ruff
|
- id: ruff
|
||||||
entry: ruff check --config dev_config/python/ruff.toml opendevin/ agenthub/
|
entry: ruff check --config dev_config/python/ruff.toml
|
||||||
types_or: [python, pyi, jupyter]
|
types_or: [python, pyi, jupyter]
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
# Run the formatter.
|
# Run the formatter.
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
entry: ruff check --config dev_config/python/ruff.toml opendevin/ agenthub/
|
entry: ruff format --config dev_config/python/ruff.toml
|
||||||
types_or: [python, pyi, jupyter]
|
types_or: [python, pyi, jupyter]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
|
|||||||
@ -15,7 +15,9 @@ ignore = [
|
|||||||
"E501",
|
"E501",
|
||||||
]
|
]
|
||||||
|
|
||||||
flake8-quotes = {inline-quotes = "single"}
|
[lint.flake8-quotes]
|
||||||
|
docstring-quotes = "double"
|
||||||
|
inline-quotes = "single"
|
||||||
|
|
||||||
[format]
|
[format]
|
||||||
quote-style = "single"
|
quote-style = "single"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user