Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- 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

- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort

- repo: local
hooks:
- id: pyink
name: pyink
entry: pyink --config pyproject.toml
language: system
types: [python]

- id: mypy
name: mypy
entry: mypy --config-file pyproject.toml
language: system
types: [python]
files: ^src/
pass_filenames: false
26 changes: 21 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,23 @@ part before or alongside your code PR.

**NOTE**: for convenience, installing all extra deps as a starting point.

5. **Run unit tests:**
5. **Install pre-commit hooks (optional but recommended):**

[pre-commit](https://pre-commit.com/) automatically runs formatting and
linting checks before each commit, helping catch issues early.

```shell
pip install pre-commit
pre-commit install
```

To run all hooks manually against all files:

```shell
pre-commit run --all-files
```

6. **Run unit tests:**

```shell
pytest ./tests/unittests
Expand All @@ -200,7 +216,7 @@ part before or alongside your code PR.
- Run the unit tests
- Restore the full development environment (`--all-extras`)

6. **Auto-format the code:**
7. **Auto-format the code:**

**NOTE**: We use `isort` and `pyink` for styles. Use the included
autoformat.sh to auto-format.
Expand All @@ -209,13 +225,13 @@ part before or alongside your code PR.
./autoformat.sh
```

7. **Build the wheel file:**
8. **Build the wheel file:**

```shell
uv build
```

8. **Test the locally built wheel file:** Have a simple testing folder setup as
9. **Test the locally built wheel file:** Have a simple testing folder setup as
mentioned in the
[quickstart](https://google.github.io/adk-docs/get-started/quickstart/).

Expand All @@ -228,7 +244,7 @@ part before or alongside your code PR.
```

```shell
command -v deactivate >/dev/null 2>&1 && deactivate
command -v deactivate > /dev/null 2>&1 && deactivate
```

```shell
Expand Down