Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiP] Set coding style for libhanjp #47

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Commits on Apr 8, 2022

  1. chore: convert tab indent into 4 spaces

    For consistent indentation, change mixed indentation into one.
    As the libhangul and previous code base uses 4 spaces for indentation,
    convert all tab characters into 4 spaces.
    
    Signed-off-by: JaeSang Yoo <[email protected]>
    JSYoo5B committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    bb79de2 View commit details
    Browse the repository at this point in the history
  2. chore: format code blocks

    1. Bracket ('{') rules
       * Functions, structure, union, class, enums
         Opening and closing brackets are placed on separate line.
       * Control-flow statements (ex. if, for, while...)
         Opening bracket should be in same line.
         If-else like code blocks, closing bracket can be in same line.
         (ex. "} else {")
    2. Newline ('\n') rules
       * Definition/declaration of functions
         All keywords related with signature should be in same line.
         (extern/static, return type, parameters)
         When the signature is too long to represent in single line,
         try to break in parameters.
       * Space between function & etc.
         Use single newline to split paragraph in function code blocks.
         Use double newline to distinguish between function definitions.
         No need to use additional newline for declaring multiple functions.
    3. Spacing rules
       * Control-flow statements
         Split control-flow statements, conditions, bracket with spaces.
       * Definition/declaration of functions
         Do not split function name and its parameter definition.
       * Calling functions
         Do not split argument passing parenthesis of function call.
    
    Signed-off-by: JaeSang Yoo <[email protected]>
    JSYoo5B committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    9b76bfe View commit details
    Browse the repository at this point in the history
  3. refactor: improve readability in kana conversion

    * declare conversion functions near its related constants definition
    * change magic numbers (conversion result) into constants
    
    Signed-off-by: JaeSang Yoo <[email protected]>
    JSYoo5B committed Apr 8, 2022
    Configuration menu
    Copy the full SHA
    219f3e2 View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2022

  1. chore: format comment styles

    * Prefer use single line comment with //
      * To describe simple comment about codeblock below
      * To describe after the code line
    * Prefer use multiple line comment with /* */
      * Always use /* */ for multiple line comment
      * To emphasize code block below
        (ex. Interface Implementation)
      * Documentation such as doxygen (not applied yet)
    
    Signed-off-by: JaeSang Yoo <[email protected]>
    JSYoo5B committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    5c22882 View commit details
    Browse the repository at this point in the history
  2. docs: Add coding convention document

    * Defines coding convention
    * Rules are proposed in commit bb79de2, 9b76bfe, 5c22882
    * General rules are refereneced from zeromq
    
    Signed-off-by: JaeSang Yoo <[email protected]>
    JSYoo5B committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    4ae1c7e View commit details
    Browse the repository at this point in the history