-
Notifications
You must be signed in to change notification settings - Fork 44
docs: Add cursor rules file and update contributing documentation #420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
3ae9302
Add cursor rules file and update contributing documentation
devin-ai-integration[bot] c6c49fc
Update wording in CONTRIBUTING.md and add cross-reference in cursor r…
devin-ai-integration[bot] ebf7f07
Remove stale isort split directive guidance
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| Here are some notes for Python CDK development. | ||
|
|
||
| For comprehensive development guidelines, please also refer to the [CONTRIBUTING.md](./docs/CONTRIBUTING.md) file which contains important information for human developers. | ||
|
|
||
| ## Development Setup | ||
|
|
||
| * Use Poetry for dependency management | ||
| - Install dependencies with `poetry install --all-extras` | ||
| - Run commands with `poetry run` or activate the virtual environment | ||
| - Use Poe tasks for common operations: `poetry run poe list` | ||
|
|
||
| ## Testing | ||
|
|
||
| * Write unit tests in the `unit_tests` directory | ||
| - Tests should follow the same directory structure as the code they test | ||
| - Use pytest fixtures for common test setup | ||
| - Run tests with `poetry run poe pytest` or `poetry run poe pytest-fast` for faster tests | ||
|
|
||
| ## Linting and Formatting | ||
|
|
||
| * Use Ruff for linting and formatting | ||
| - Run `poetry run poe format-fix` to auto-fix formatting issues | ||
| - Run `poetry run poe lint` to check for linting issues | ||
| - Run `poetry run poe check-all` to run all checks | ||
|
|
||
| ## Code Organization | ||
|
|
||
| * Follow the existing module structure | ||
| - Place new code in the appropriate module based on functionality | ||
| - Use relative imports within modules | ||
| - Avoid circular dependencies by careful import ordering | ||
|
|
||
| ## Import Conventions | ||
|
|
||
| * Avoid circular dependencies by following these guidelines: | ||
| - Submodules should import from lower-level modules, not from the top-level `airbyte_cdk` package | ||
| - Use `if TYPE_CHECKING:` blocks for imports that are only used as type hints | ||
| - For modules with circular dependency risks, use explicit relative imports | ||
|
|
||
| * Special handling for `__init__.py` files: | ||
| - Do not auto-sort imports in `__init__.py` files with isort | ||
| - When a module depends on classes defined within the same module, use the isort split directive: | ||
| ```python | ||
| # Import the base class first | ||
| from .transformation import RecordTransformation | ||
|
|
||
| # isort: split | ||
| # Then import the implementations | ||
| from .add_fields import AddFields | ||
| from .remove_fields import RemoveFields | ||
| ``` | ||
|
|
||
| ## Docstring Standards | ||
|
|
||
| * Use Google-style docstrings | ||
| - First sentence must be a one-liner on the same line as opening `"""` and end with a period | ||
| - Multi-line docstrings require a blank line after the one-liner | ||
| - Args section is optional, but if "args:" is specified, all arguments must be documented | ||
| - Argument types should not be documented in docstrings as they are already in function signatures | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this guidance is stale and should be fully removed.