|
| 1 | +--- |
| 2 | +alwaysApply: true |
| 3 | +--- |
| 4 | + |
| 5 | +# GoodData Python SDK Coding Guidelines |
| 6 | + |
| 7 | +Applies to all packages and code in this Python SDK workspace. |
| 8 | +Think in steps before changes. Search for relevant cursor rules based on the character of changes. |
| 9 | + |
| 10 | +## Core Principles |
| 11 | + |
| 12 | +**Search first, don't invent**: Always search this repository for everything related to the developer question. **Do not invent a new design for something that already exists!** |
| 13 | + |
| 14 | +**Code Principles**: **1** Simplicity, **2** Readability, **3** Performance (don't over-optimize), **4** Maintainability, **5** Testability, **6** Reusability, **7** Encapsulation & single responsibility |
| 15 | + |
| 16 | +## ⚠️ CRITICAL: AI Behavior Rules - ALWAYS ENFORCE |
| 17 | + |
| 18 | +**NO AUTO-IMPLEMENTATION**: |
| 19 | +- Do not generate code changes unless user explicitly asks for it |
| 20 | +- NEVER create summary/documentation markdown files unless explicitly requested |
| 21 | +- Break complex tasks into smaller deliverable units |
| 22 | + |
| 23 | +**For complex tasks**: |
| 24 | +1. Implement ONLY the first task, then STOP |
| 25 | +2. Ask permission to continue, offering: (a) next task only, or (b) all remaining tasks |
| 26 | +3. Create todos but DO NOT auto-implement them |
| 27 | +4. When in doubt, ask before implementing |
| 28 | + |
| 29 | +## Code Validation |
| 30 | + |
| 31 | +**If gdc-ruler MCP server is available**: Use `validate_python` tool with this workspace path. |
| 32 | +``` |
| 33 | +validate_python(path=".") # From workspace root |
| 34 | +``` |
| 35 | + |
| 36 | +**Otherwise**: Run manually: |
| 37 | +```bash |
| 38 | +make format-fix && make mypy && make test |
| 39 | +``` |
| 40 | + |
| 41 | +**Scoped testing**: `TEST_ENVS=py312 ADD_ARGS="-k test_name" make test` |
| 42 | + |
| 43 | +See `technologies/testing` rule for VCR cassette workflow. |
| 44 | + |
| 45 | +## Package Structure |
| 46 | + |
| 47 | +**Workspace packages** (in `packages/`): |
| 48 | +- `gooddata-sdk` - Core SDK for GoodData Cloud |
| 49 | +- `gooddata-pandas` - Pandas integration layer |
| 50 | +- `gooddata-dbt`, `gooddata-flight-server`, `gooddata-flexconnect`, `gooddata-pipelines` |
| 51 | +- `tests-support` - Shared test utilities |
| 52 | + |
| 53 | +**Generated clients** (do NOT edit manually): |
| 54 | +- `gooddata-api-client` - Generated from OpenAPI specs |
| 55 | + |
| 56 | +## Dependencies |
| 57 | + |
| 58 | +**Internal**: Use `~={current_version}` for package dependencies. |
| 59 | + |
| 60 | +**Adding**: Add to `pyproject.toml`, run `uv lock`. |
| 61 | + |
| 62 | +## OpenAPI Client Generation |
| 63 | + |
| 64 | +**DO NOT manually edit** generated client code in `gooddata-*-client/` directories. |
| 65 | + |
| 66 | +See `.openapi-generator/README.md` for regeneration instructions. |
| 67 | + |
| 68 | +## Fast-Changing Dependencies |
| 69 | + |
| 70 | +**When suggesting third-party libraries**: Verify current APIs, prefer established libraries, check Python 3.10+ compatibility. |
0 commit comments