| description | |
|---|---|
| globs | |
| alwaysApply | true |
- this project uses Bazel build system for TypeScript and some Java code.
- this project uses Gradle build system for Android related code (mostly under the forlder
/ime,/apiand/addons). - Prefer not adding new 3rd party dependencies.
- Do not add 3rd-party dependencies without approval. If you have a solution that requires a new 3rd party, ask for an approval before implementing this solution.
- Do not use the build task
buildin gradle! This task is usually not compatible with Android builds. Prefer usingassembleDebug.
- don't try to fix linting or formatting issues, we have auto-fixers for that. This is applicable for all code in the codebase.
- You can run the auto-fixers with
bazel run //:format. This is applicable for all code in the codebase. - for Android code, you should also run
./gradle spotlessApply, which had additional formating and linting.
Before creating a commit always run bazel run //:format.
If the changed code is related to Android, also run ./gradle spotlessApply.
When creating a commit message, follow these guidelines:
- Title: Use a concise title. Prefix the title with "[LLM]"
- Description: The description should include a short description of the issue (bug, feature-request, crash, chore, etc) and a short description of the solution. Add your name at the end of the description to signify the commit was made by an AI Agent.
- when ask to suggest tests for a function or file:
- Do not implement anything or suggest how to implement.
- You should only look at the code and suggest tests based on functionality and error cases.
- Identify the "happy path" - core functionality - cases and mark them as such in your suggestions
- Identify the error cases and mark them as such in your suggestions. Estimate importance based on likelyhood.
- Identify the edge cases and mark them as such in your suggestions. Estimate importance based on likelyhood.
- when implementing tests:
- For TypeScript, the test file name follows the pattern
[original_file_name].test.ts - For Java and Kotlin, the test file name follows the pattern
[original_file_name]Test.java - For typescript, use
nodetest runner. Look at other test files for inspiration. - prefer creating fakes over mocks or patches. But, if it is simpler to patch or mock, do that.
- it is not very important to type mocks/spies/patch. You can use
any. In such cases, ignore the typing with// @ts-expect-error any in tests is fine
- For TypeScript, the test file name follows the pattern
- To run tests in bazel use
bazel test //... - To run tests in gradle use
./gradlew :[path]:[to]:[module]:testDebugUnitTest. For example, to run test underime/base-rx, call./gradlew :ime:base-rx:testDebugUnitTest. - When running tests in the module
:ime:app, ensure you are using the test filter--testsand filter for the desired test class. For example, to run tests forKeyPreviewsManagerTestin:ime:app, use./gradlew :ime:app:testDebugUnitTest --tests "com.anysoftkeyboard.keyboards.views.preview.KeyPreviewsManagerTest".
- use inclusive language when creating variables, functions, class names, stubs, etc:
- Do not use "dummy", instead use "fake", "mock", "noop" etc.
- Do not use "blacklist", instead use "disallow-list"
- Do not use "whilelist", instead use "allow-list"
- Stay away from: "master", "slave", "insane", "dumb", etc.
- Use gender neutral pronouns