From eda5ab92c010822f638047a657bad6b8eaba3e41 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 10:08:46 +0200 Subject: feat: ✨ Add project coding standards for Python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Introduced guidelines for naming conventions and error handling. * Specified the use of `snake_case` for variables, `CamelCase` for classes, and PEP 8 compliance. * Emphasized the importance of type hints and docstrings in code documentation. --- .github/copilot-instructions.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/copilot-instructions.md (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..94aae70 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,20 @@ +--- +applyTo: "**/*.py" +--- + +# Project general coding standards + +## Naming Conventions + +- Use snake_case for variable and function names. +- Use CamelCase for class names. +- Follow PEP 8 style guidelines. +- Include type hints for function parameters and return types. +- Write docstrings for all public modules, classes, functions, and methods using google docsrting style. +- Prefix private class members with underscore (\_) +- Use ALL_CAPS for constants + +## Error Handling + +- Use try/except blocks for async operations +- Always log errors with contextual information -- cgit v1.3.1 From ca927984d350328323b7d907067119cc2f19baf6 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 10:34:20 +0200 Subject: chore: 🔧 Update docstring guidelines in coding standards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changed "Write docstrings for all public modules, classes, functions, and methods" to "Always write doc strings for all modules, classes, functions, and methods." * Added missing punctuation for consistency in error handling guidelines. --- .github/copilot-instructions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 94aae70..0c3735c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -10,11 +10,11 @@ applyTo: "**/*.py" - Use CamelCase for class names. - Follow PEP 8 style guidelines. - Include type hints for function parameters and return types. -- Write docstrings for all public modules, classes, functions, and methods using google docsrting style. -- Prefix private class members with underscore (\_) -- Use ALL_CAPS for constants +- Always write doc strings for all modules, classes, functions, and methods using google docstring style. +- Prefix private class members with underscore (\_). +- Use ALL_CAPS for constants. ## Error Handling -- Use try/except blocks for async operations -- Always log errors with contextual information +- Use try/except blocks for async operations. +- Always log errors with contextual information. -- cgit v1.3.1 From de47935f049cdab38cbe5ccd665176761ec2c632 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 10:46:41 +0200 Subject: chore: 🔧 Update coding standards for Python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added a guideline to use the newest coding style supported by the used Python version. --- .github/copilot-instructions.md | 1 + 1 file changed, 1 insertion(+) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0c3735c..0604a99 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -13,6 +13,7 @@ applyTo: "**/*.py" - Always write doc strings for all modules, classes, functions, and methods using google docstring style. - Prefix private class members with underscore (\_). - Use ALL_CAPS for constants. +- Use newest coding style which is supported by the used Python version. ## Error Handling -- cgit v1.3.1 From 1f7d8a15e2a9480976b3a1bc2af84aa939bd2c27 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 11:04:58 +0200 Subject: chore: 🔧 Update docstring guidelines for typing usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added clarification to the docstring guidelines to include the use of `typing` in docstrings. --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0604a99..f10cd46 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -10,7 +10,7 @@ applyTo: "**/*.py" - Use CamelCase for class names. - Follow PEP 8 style guidelines. - Include type hints for function parameters and return types. -- Always write doc strings for all modules, classes, functions, and methods using google docstring style. +- Always write doc strings for all modules, classes, functions, and methods using google docstring style. Use typing in doc strings. - Prefix private class members with underscore (\_). - Use ALL_CAPS for constants. - Use newest coding style which is supported by the used Python version. -- cgit v1.3.1 From 4dde8c819a82a763e8b5df8a843559a2aafd3e4b Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 11:33:04 +0200 Subject: chore: 🔧 Update coding standards and documentation guidelines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refined coding guidelines for clarity and structure. * Added sections for type annotations and docstring requirements. * Ensured consistency in documentation practices across the project. --- .github/copilot-instructions.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f10cd46..472850f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -9,13 +9,21 @@ applyTo: "**/*.py" - Use snake_case for variable and function names. - Use CamelCase for class names. - Follow PEP 8 style guidelines. -- Include type hints for function parameters and return types. -- Always write doc strings for all modules, classes, functions, and methods using google docstring style. Use typing in doc strings. - Prefix private class members with underscore (\_). - Use ALL_CAPS for constants. -- Use newest coding style which is supported by the used Python version. ## Error Handling - Use try/except blocks for async operations. - Always log errors with contextual information. + +## Coding Guidelines + +- Use type annotations for function parameters, return types and variables. +- Use newest coding style which is supported by the used Python version. + +## Code Documentation + +- Always write doc strings for all modules, classes, functions, and methods using google docstring style. +- Use typing in doc strings. +- Use short inline comments to explain complex logic. -- cgit v1.3.1 From 395771a93904389832e0079531f53db90fdd1ac6 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Tue, 1 Jul 2025 14:36:37 +0200 Subject: refactor(guidelines): ✨ Update coding standards for type annotations and add PEP references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Clarified type annotations usage for function parameters, return types, and variables. * Added guidelines for using blank lines, coroutines, and string interpolation as per PEP standards. --- .github/copilot-instructions.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 472850f..c890c0c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -19,8 +19,12 @@ applyTo: "**/*.py" ## Coding Guidelines -- Use type annotations for function parameters, return types and variables. +- Use type annotations / hints for function and method parameters, return types and variables. Follow PEP 484. - Use newest coding style which is supported by the used Python version. +- Use blank lines to keep code organized and readable. +- Follow PEP 492 – Coroutines with async and await syntax +- Follow PEP 498 – Literal String Interpolation +- Follow PEP 572 – Assignment Expressions ## Code Documentation -- cgit v1.3.1 From 6d62a3b5c040abd9a0a666c5a930fcd5378101f3 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Wed, 2 Jul 2025 08:49:32 +0200 Subject: refactor(guidelines): ✨ Update coding standards for type annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added a guideline to use modern built-in generics from the `typing` module. * This change aligns with PEP 484 and promotes better coding practices. --- .github/copilot-instructions.md | 1 + 1 file changed, 1 insertion(+) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index c890c0c..bc8e87e 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -20,6 +20,7 @@ applyTo: "**/*.py" ## Coding Guidelines - Use type annotations / hints for function and method parameters, return types and variables. Follow PEP 484. +- Use the modern built-in generics from the `typing` module, such as `list`, `dict`, and `set`, instead of the older `List`, `Dict`, and `Set` from `typing`. - Use newest coding style which is supported by the used Python version. - Use blank lines to keep code organized and readable. - Follow PEP 492 – Coroutines with async and await syntax -- cgit v1.3.1 From 6d7f4f1625cb57f3d8c58f9b2e07dd759834cc23 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Wed, 2 Jul 2025 09:56:57 +0200 Subject: refactor(guidelines): ✨ Improve clarity in coding standards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enhanced wording for better understanding of blank line usage. * Clarified instructions on updating docstrings during refactoring. * Specified the use of line comments for complex logic explanations. --- .github/copilot-instructions.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index bc8e87e..f62d2fa 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -22,7 +22,7 @@ applyTo: "**/*.py" - Use type annotations / hints for function and method parameters, return types and variables. Follow PEP 484. - Use the modern built-in generics from the `typing` module, such as `list`, `dict`, and `set`, instead of the older `List`, `Dict`, and `Set` from `typing`. - Use newest coding style which is supported by the used Python version. -- Use blank lines to keep code organized and readable. +- Use more blank lines to achieve better code organization and readability. - Follow PEP 492 – Coroutines with async and await syntax - Follow PEP 498 – Literal String Interpolation - Follow PEP 572 – Assignment Expressions @@ -31,4 +31,6 @@ applyTo: "**/*.py" - Always write doc strings for all modules, classes, functions, and methods using google docstring style. - Use typing in doc strings. -- Use short inline comments to explain complex logic. +- Use line comments to explain complex logic. +- If refactoring code, ensure to update or add doc strings accordingly. +- If refactoring code to not remove existing line comments, but to update them to reflect the new code logic. -- cgit v1.3.1