-
Notifications
You must be signed in to change notification settings - Fork 7.7k
EDIT: Update python code guide and include linting, formatting and type checking #22737
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Noting that we'll get #22676 merged first before reviewing as it will cause conflicts. |
Hi @estebanx64, thank you for updating this. The PR mentioned above has been merged and is causing a conflict. Please help resolve the conflicts and let me know if you need any help. |
Hi @craig-osterhout, is yours now |
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.
Thank you for adding this, @estebanx64. It's looking really good. Added a few small style suggestions.
@@ -0,0 +1,122 @@ | |||
--- | |||
title: Linting, Formatting and Type Checking for Python |
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.
title: Linting, Formatting and Type Checking for Python | |
title: Linting, formatting, and type checking for Python |
@@ -0,0 +1,122 @@ | |||
--- | |||
title: Linting, Formatting and Type Checking for Python | |||
linkTitle: Linting and Typing |
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.
linkTitle: Linting and Typing | |
linkTitle: Linting and typing |
- Static type checking with Pyright | ||
- Automating checks with pre-commit hooks | ||
|
||
## Linting and Formatting with Ruff |
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.
## Linting and Formatting with Ruff | |
## Linting and formatting with Ruff |
ruff format . | ||
``` | ||
|
||
## Type Checking with Pyright |
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.
## Type Checking with Pyright | |
## Type checking with Pyright |
|
||
These tools help maintain code quality and catch errors early in development. | ||
|
||
## Next Steps |
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.
## Next Steps | |
## Next steps |
|
||
## Setting up pre-commit hooks | ||
|
||
Pre-commit hooks automatically run checks before each commit. in `.pre-commit-config.yaml` sets up Ruff: |
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.
Pre-commit hooks automatically run checks before each commit. in `.pre-commit-config.yaml` sets up Ruff: | |
Pre-commit hooks automatically run checks before each commit. The following `.pre-commit-config.yaml` snippet sets up Ruff: |
|
||
## Next Steps | ||
|
||
- [Configure Github Actions](configure-github-actions.md) to run these checks automatically |
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.
- [Configure Github Actions](configure-github-actions.md) to run these checks automatically | |
- [Configure GitHub Actions](configure-github-actions.md) to run these checks automatically |
Pre-commit hooks automatically run checks before each commit. in `.pre-commit-config.yaml` sets up Ruff: | ||
|
||
```yaml | ||
: https: https://github.com/charliermarsh/ruff-pre-commit |
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.
The YAML line starts with :
. I'm guessing it's a typo, but I'm not sure.
Description
@craig-osterhout
@usha-mandya