styling and readability

This commit is contained in:
Frank
2025-12-03 15:38:14 +01:00
committed by GitHub
parent a65137c50b
commit 00e063d89e

View File

@@ -12,6 +12,8 @@ A good description helps us to review and understand your proposed changes. For
* testing you performed, known limitations, open ends you possibly could not solve. * testing you performed, known limitations, open ends you possibly could not solve.
* any areas where you like to get help from an experienced maintainer (yes WLEDMM has become big 😉) * any areas where you like to get help from an experienced maintainer (yes WLEDMM has become big 😉)
## Your Pull Request (PR)
### Target branch for pull requests ### Target branch for pull requests
Please make all PRs against the `mdev` branch. Please make all PRs against the `mdev` branch.
@@ -30,7 +32,7 @@ Github will pick up the changes so your PR stays up-to-date.
You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR You can find a collection of very useful tips and tricks here: https://github.com/wled-dev/WLED/wiki/How-to-properly-submit-a-PR
### Source Code from an AI agent or bot ## Source Code from an AI agent or bot
> [!IMPORTANT] > [!IMPORTANT]
> Its OK if you took help from an AI for writing your source code. > Its OK if you took help from an AI for writing your source code.
> >
@@ -40,7 +42,7 @@ You can find a collection of very useful tips and tricks here: https://github.co
* Remember that AI are still "Often-Wrong" ;-) * Remember that AI are still "Often-Wrong" ;-)
* If you don't feel very confident using English, you can use AI for translating code comments and descriptions into English. AI bots are very good at understanding language. However, always check if the results is correct. The translation might still have wrong technical terms, or errors in some details. * If you don't feel very confident using English, you can use AI for translating code comments and descriptions into English. AI bots are very good at understanding language. However, always check if the results is correct. The translation might still have wrong technical terms, or errors in some details.
#### best practice with AI: ### best practice with AI:
* As the person who contributes source code to WLED, make sure you understand exactly what the AI generated code does * As the person who contributes source code to WLED, make sure you understand exactly what the AI generated code does
* best practice: add a comment like ``'// below section of my code was generated by an AI``, when larger parts of your source code were not written by you personally. * best practice: add a comment like ``'// below section of my code was generated by an AI``, when larger parts of your source code were not written by you personally.
* always review translations and code comments for correctness * always review translations and code comments for correctness
@@ -53,12 +55,12 @@ You can find a collection of very useful tips and tricks here: https://github.co
When in doubt, it is easiest to replicate the code style you find in the files you want to edit :) When in doubt, it is easiest to replicate the code style you find in the files you want to edit :)
Below are the guidelines we use in the WLED repository. Below are the guidelines we use in the WLED repository.
#### Indentation ### Indentation
We use tabs for Indentation in Web files (.html/.css/.js) and spaces (2 per indentation level) for all other files. We use tabs for Indentation in Web files (.html/.css/.js) and spaces (2 per indentation level) for all other files.
You are all set if you have enabled `Editor: Detect Indentation` in VS Code. You are all set if you have enabled `Editor: Detect Indentation` in VS Code.
#### Blocks ### Blocks
Whether the opening bracket of e.g. an `if` block is in the same line as the condition or in a separate line is up to your discretion. If there is only one statement, leaving out block braces is acceptable. Whether the opening bracket of e.g. an `if` block is in the same line as the condition or in a separate line is up to your discretion. If there is only one statement, leaving out block braces is acceptable.
@@ -103,7 +105,7 @@ if( a==b ){
} }
``` ```
#### Comments ### Comments
Comments should have a space between the delimiting characters (e.g. `//`) and the comment text. Comments should have a space between the delimiting characters (e.g. `//`) and the comment text.
Note: This is a recent change, the majority of the codebase still has comments without spaces. Note: This is a recent change, the majority of the codebase still has comments without spaces.