Skip to content

Commit 533776e

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Switch to pre-commit and cleanup redundant tools
Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 905187116
1 parent 9a0d2f7 commit 533776e

8 files changed

Lines changed: 15 additions & 236 deletions

File tree

.github/workflows/isort.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/pyink.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2026 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
repos:
162
- repo: https://github.com/pre-commit/pre-commit-hooks
173
rev: v4.6.0
@@ -47,5 +33,6 @@ repos:
4733
hooks:
4834
- id: mdformat
4935
files: ^(README\.md|CONTRIBUTING\.md|contributing/.*\.md)$
36+
exclude: (?i)SKILL\.md$
5037
additional_dependencies:
5138
- mdformat-gfm

AGENTS.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,7 @@ the key style points:
255255

256256
### Autoformat (Required Before Committing)
257257

258-
**Always run** before committing code: `bash ./autoformat.sh`
259-
260-
**Manual formatting** (if needed): ```bash
261-
262-
# Format imports
263-
264-
isort src/ tests/ contributing/
265-
266-
# Format code style
267-
268-
pyink --config pyproject.toml src/ tests/ contributing/ ```
258+
**Always run** before committing code: `pre-commit run --all-files`
269259

270260
**Check formatting** without making changes: `bash pyink --check --diff --config
271261
pyproject.toml src/ isort --check src/`
@@ -512,7 +502,9 @@ Quick reference to important project files:
512502
- **Main config:** `pyproject.toml` (uses `flit_core` build backend)
513503
- **Dependencies:** `uv.lock` (managed by `uv`)
514504
- **Linting:** `pylintrc` (Google Python Style Guide)
515-
- **Auto-format:** `autoformat.sh` (runs isort + pyink)
505+
- **Auto-format:** `pre-commit` (runs isort + pyink)
506+
- **Run on all files:** `pre-commit run --all-files`
507+
- **Install as hook:** `pre-commit install`
516508
- **CLI entry point:** `src/google/adk/cli/cli_tools_click.py`
517509
- **Web UI backend:** `src/google/adk/cli/adk_web_server.py`
518510
- **Main exports:** `src/google/adk/__init__.py` (exports Agent, Runner)

CONTRIBUTING.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,18 @@ part before or alongside your code PR.
202202

203203
1. **Auto-format the code:**
204204

205-
**NOTE**: We use `isort` and `pyink` for styles. Use the included
206-
autoformat.sh to auto-format.
205+
We use `pre-commit` to manage code style and formatting (including `isort` and `pyink`).
206+
207+
To run it manually on all files:
208+
209+
```shell
210+
pre-commit run --all-files
211+
```
212+
213+
You can also install it as a git hook to run automatically on every commit:
207214

208215
```shell
209-
./autoformat.sh
216+
pre-commit install
210217
```
211218

212219
1. **Build the wheel file:**

autoformat.sh

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
google-adk[a2a]==1.28.1
2-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
google-adk==1.28.1
2-

0 commit comments

Comments
 (0)