Bläddra i källkod

Add coding guidelines for code contribution

Patrick-Christopher Mattulat 2 månader sedan
förälder
incheckning
191a289c5b
1 ändrade filer med 25 tillägg och 0 borttagningar
  1. 25 0
      doc/internal/coding-guidelines.md

+ 25 - 0
doc/internal/coding-guidelines.md

@@ -0,0 +1,25 @@
+# Coding Guidelines
+
+This document describes the rules to be followed when contributing to this code base.
+
+## Code Format
+
+The code format for this library is defined via ClangFormat configured in the __.clang-format__ file.  
+This format must be used for the code.
+
+## Clean Code
+
+Clean code rules are defined via ClangTidy configured in the __.clang-tidy__ file. This rules must be followed.
+
+## Naming Convention
+
+The following naming conventions must be met for code contribution:
+
+1. Class names follow the CamelCase convention, where the first letter is an upper case letter.
+2. Class methods follow the CamelCase convention, where the first letter is a lower case letter, when the method is public.
+3. Class methods follow the CamelCase convention, where the first letter is an underscore letter, followed by a lower case letter, when the method is private.
+4. Method and function parameter follow the CamelCase convention, where the first letter is an underscore letter, followed by a lower case letter.
+5. Private class members follow the CamelCase convention, where the first letter starts with a lower case letter.
+6. Header or source files of classes must meet the same naming convention as for class names, followed by the class extension (.cpp for source files, .hpp for header files).
+7. Class methods with a return type other than void must be declared with __[[nodiscard]]__.
+8. Class methods with an optional return type other than void must be declared with __[[maybe_unused]]__.