From 5429091acc829fc237774f5d2e4e840ae0dac30a Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Mon, 24 Mar 2025 05:24:33 +0000 Subject: [PATCH] pages: Add coding tips --- .../guides/contribution/index.md | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/pages/opportunities/guides/contribution/index.md b/pages/opportunities/guides/contribution/index.md index 0f556b5e..99b08085 100644 --- a/pages/opportunities/guides/contribution/index.md +++ b/pages/opportunities/guides/contribution/index.md @@ -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.