|
| 1 | +# ADK CRUSH.md |
| 2 | + |
| 3 | +This file contains commands and style guidelines for the ADK project. |
| 4 | + |
| 5 | +## Testing |
| 6 | + |
| 7 | +Run all unit tests: |
| 8 | +`pytest tests/unittests` |
| 9 | + |
| 10 | +Run a single test file: |
| 11 | +`pytest tests/unittests/path/to/test_file.py` |
| 12 | + |
| 13 | +Run a single test function: |
| 14 | +`pytest tests/unittests/path/to/test_file.py::test_function` |
| 15 | + |
| 16 | +## Linting and Formatting |
| 17 | + |
| 18 | +Run the autoformatter: |
| 19 | +`./autoformat.sh` |
| 20 | + |
| 21 | +Run the linter: |
| 22 | +`pylint --rcfile=pylintrc src/` |
| 23 | + |
| 24 | +Run the type checker: |
| 25 | +`mypy --config-file=pyproject.toml src/` |
| 26 | + |
| 27 | +## Code Style |
| 28 | + |
| 29 | +- Follow the Google Python Style Guide. |
| 30 | +- **Indentation**: 2 spaces. |
| 31 | +- **Line Length**: 80 characters. |
| 32 | +- **Naming Conventions**: |
| 33 | + - `function_and_variable_names`: `snake_case` |
| 34 | + - `ClassNames`: `CamelCase` |
| 35 | + - `CONSTANTS`: `UPPERCASE_SNAKE_CASE` |
| 36 | +- **Docstrings**: Required for all public modules, functions, classes, and methods. |
| 37 | +- **Imports**: |
| 38 | + - Use relative imports within the `src/google/adk` directory (e.g., `from ..agents.llm_agent import LlmAgent`). |
| 39 | + - Use absolute imports in tests (e.g., `from google.adk.agents.llm_agent import LlmAgent`). |
| 40 | + - Always include `from __future__ import annotations` at the beginning of each file. |
| 41 | +- **Error Handling**: Catch specific exceptions, not general ones like `Exception`. |
| 42 | + |
| 43 | +## Refactoring Guidelines |
| 44 | + |
| 45 | +- When removing a feature, ensure that all related components are removed, including: |
| 46 | + - Services |
| 47 | + - API endpoints |
| 48 | + - Models |
| 49 | + - UI elements |
| 50 | + - Documentation |
| 51 | +- When switching from a local execution to a containerized deployment, ensure that the `Dockerfile` and `run.sh` scripts are updated accordingly. |
| 52 | +- When deploying to a new platform, ensure that the `cloudbuild.yaml` file is updated to reflect the new deployment target. |
| 53 | + |
| 54 | +## Agent Goals |
| 55 | + |
| 56 | +- Showcase the full power and capabilities of the ADK. |
| 57 | +- Provide a local ADK development environment for customers to experiment with. |
| 58 | +- Offer a guided walkthrough of all ADK features. |
| 59 | +- Demonstrate the integration between ADK and a Streamlit frontend. |
| 60 | +- Provide a clear path to deploying the agent to Cloud Run within a customer's VPC. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
0 commit comments