Skip to content

pages: Add coding tips #211

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

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions pages/opportunities/guides/contribution/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,26 @@ should review those for each project.
requests without following up or addressing review recommendations, which can
impede progress.

- **Code Quality:** Contributors must ensure that `pre-commit` is applied in
their branch before opening a pull request. Additionally, they should adhere
to coding best practices, such as avoiding excessive nesting blocks, following
SOLID principles, and refraining from assigning different types to the same
variable. It is important to consult the project's specific coding guidelines
for additional best practices.

- **Branch Management:** When updating a branch, contributors should follow the
project's preferred approach, whether that involves using a **rebase** or a
**merge commit**.

- **Commenting Practices:** Excessive or unnecessary comments should be avoided,
as well the use of emojis in comments, as they may suggest that the content
was generated entirely by an AI.
- If your PR is not ready yet for review, please keep it in **draft mode**.

## Coding Tips

- Ensure that `pre-commit` is applied to your branch before opening a pull
request. Run `pre-commit install` to enable pre-commit hooks, ensuring they
are applied automatically before every commit.
- Avoid excessive nesting. Try to keep nesting levels to **four or fewer** for
better readability and maintainability.
- Follow the project's specific coding guidelines. Review them regularly to
ensure consistency across contributions.
- Remove any unnecessary comments. In most cases, if you need to explain what
your code does, it may indicate that the code is unclear or overly complex.
This is also often a sign of code generated by Generative AI.
- Do not use emojis in comments. This is typically seen as a red flag and may
suggest improper use of AI-generated content.
- Ensure there is an empty line at the end of each file. GitHub highlights
missing end-of-file newlines with a red icon. Configure your IDE to
automatically add this final newline.
Loading