PengZheng commented on code in PR #544:
URL: https://github.com/apache/celix/pull/544#discussion_r1187444600


##########
documents/development/README.md:
##########
@@ -0,0 +1,539 @@
+---
+title: Apache Celix Coding Conventions
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Apache Celix Coding Conventions
+Adhering to consistent and meaningful coding conventions is crucial for 
maintaining readable and maintainable code.
+This document outlines the recommended coding conventions for Apache Celix 
development, including naming conventions,
+formatting, comments, control structures, functions and error handling.
+
+Note that not all existing code adheres to these conventions.
+New code should adhere to these conventions and when possible, existing code 
should be updated to adhere to these
+conventions.
+
+## Naming Conventions
+
+### C/C++ Variables
+
+- Use `camelCase` for variable names.
+- Use descriptive names for variables.
+- Use `celix_` prefix or `celix::` (sub)namespace for global variables.
+- Asterisk `*` should be placed on the variable type name.
+
+### C Structures
+
+- Use `snake_case` for structure names.
+- Add a typedef for the structure.
+- Use a `_t` postfix for structure typedef.
+- Use `celix_` prefix for structure names.
+
+### C Functions
+
+- Use descriptive names for functions.
+- Use a `celix_` prefix.
+- Use a `_<obj>_` camelCase infix for the object/module name.
+- Use a postfix `camelCase` for the function name.
+- Asterisk `*` should be placed on the variable type name.

Review Comment:
   I tried provided .clang-format, and found it does not format code like this.
   How about exporting your CLion code style both as .clang-format and IDEA 
code style XML?
   
   Zhengbao Xu and I can just import your CLion code style XML and other users 
can use .clang-format.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to