|
| 1 | +--- |
| 2 | +alwaysApply: true |
| 3 | +description: Cursor Coding Rules |
| 4 | +--- |
| 5 | + |
| 6 | +# Contributing Rules for Agents |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +sentry-java is the Java and Android SDK for Sentry. This repository contains the source code and examples for SDK usage. |
| 11 | + |
| 12 | +## Tech Stack |
| 13 | + |
| 14 | +- **Language**: Java and Kotlin |
| 15 | +- **Build Framework**: Gradle |
| 16 | + |
| 17 | +## Key Commands |
| 18 | + |
| 19 | +```bash |
| 20 | +# Format code and regenerate .api files |
| 21 | +./gradlew spotlessApply apiDump |
| 22 | + |
| 23 | +# Run all tests and linter |
| 24 | +./gradlew check |
| 25 | + |
| 26 | +# Run unit tests for a specific file |
| 27 | +./gradle ':<module>:testDebugUnitTest' --tests="*<file name>*" --info |
| 28 | +``` |
| 29 | + |
| 30 | +## Contributing Guidelines |
| 31 | + |
| 32 | +1. Follow existing code style and language |
| 33 | +2. Do not modify the API files (e.g. sentry.api) manually, instead run `./gradlew apiDump` to regenerate them |
| 34 | +3. Write comprehensive tests |
| 35 | +4. New features should always be opt-in by default, extend `SentryOptions` or similar Option classes with getters and setters to enable/disable a new feature |
| 36 | +5. Consider backwards compatibility |
| 37 | + |
| 38 | +## Coding rules |
| 39 | + |
| 40 | +1. First think through the problem, read the codebase for relevant files, and propose a plan |
| 41 | +2. Before you begin working, check in with me and I will verify the plan |
| 42 | +3. Then, begin working on the todo items, marking them as complete as you go |
| 43 | +4. Please do not describe every step of the way and just give me a high level explanation of what changes you made |
| 44 | +5. Make every task and code change you do as simple as possible. We want to avoid making any massive or complex changes. Every change should impact as little code as possible. Everything is about simplicity. |
| 45 | +6. Once you're done, format the code and regenerate the .api files using the following command `./gradlew spotlessApply apiDump` |
| 46 | +7. As a last step, git stage the relevant files and propose (but not execute) a single git commit command (e.g. `git commit -m "<git commit message>"`) |
| 47 | + |
| 48 | + |
| 49 | +## Useful Resources |
| 50 | + |
| 51 | +- Main SDK documentation: https://develop.sentry.dev/sdk/overview/ |
| 52 | +- Internal contributing guide: https://docs.sentry.io/internal/contributing/ |
| 53 | +- Git commit messages conventions: https://develop.sentry.dev/engineering-practices/commit-messages/ |
0 commit comments