Skip to content

An AI Agent that interacts with Windows OS at GUI level.

Python

ci: add ruff.toml, pre-commit config and wire into CI

jeomone998f1c92498
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d746f6d..991f247 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,14 +13,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Install uv
- uses: astral-sh/setup-uv@v4
-
- - name: Run ruff lint
- run: uvx ruff check .
-
- - name: Run ruff format check
- run: uvx ruff format --check .
+ - name: Run pre-commit hooks
+ uses: pre-commit/[email protected]
test:
name: Test (Python ${{ matrix.python-version }})
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..4d57603
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,16 @@
+repos:
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.12.1
+ hooks:
+ - id: ruff
+ args: [--fix]
+ - id: ruff-format
+
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v5.0.0
+ hooks:
+ - id: trailing-whitespace
+ - id: end-of-file-fixer
+ - id: check-yaml
+ - id: check-added-large-files
+ - id: debug-statements
diff --git a/ruff.toml b/ruff.toml
new file mode 100644
index 0000000..94e55d5
--- /dev/null
+++ b/ruff.toml
@@ -0,0 +1,18 @@
+line-length = 100
+target-version = "py310"
+
+[format]
+quote-style = "double"
+indent-style = "space"
+
+[lint]
+select = [
+ "E", # pycodestyle errors
+ "W", # pycodestyle warnings
+ "F", # pyflakes
+ "I", # isort
+ "UP", # pyupgrade
+]
+ignore = [
+ "E501", # line too long (handled by formatter)
+]