-
Notifications
You must be signed in to change notification settings - Fork 3
Dev Guide
A couple of style guide rules should be followed in this repo:
Code-structure related:
- Use 4-space indenting
- Use Unix-style line endings (LF)
- Trim whitespace at the end of lines
- End file with a newline
- Indent comments to the same indentation level as the code they refer to
Branch and commit naming related:
- Name branches after user story number they correspond to.
Example:
03.01.10
or03.01.10-testing
- Prefix commit messages with the user-story they correspond to
Example:
03.01.10: Refactors getBook() method
The goal of these rules is simply to define a standard which improves git workflows, traceability, and code readability. The exact values of the rules (spaces over tabs, etc.) are not chosen because one value is necessarily better than the other, but are rather just arbitrary defaults for consistency.
Most of these style guide rules can be handled automatically by your editor of choice. A .editorconfig file has been provided to configure your editor to meet our standards. Visual Studio Code requires you install the EditorConfig plugin. Android Studio will be automatically configured.
Below are a handful of configuration guides, feel free to add your program of choice if it's missing.
In your settings.json
file (which can be opened from the main settings page), add the following. Note that most of these are defaults anyways, but are explicitly stated here if you want to make project-level settings that conflict with global settings:
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.eol": "\n"
"files.trimTrailingWhitespace": true,
"editor.trimAutoWhitespace": true,
"files.insertFinalNewline": true,
"editor.renderFinalNewline": true // If you want to make sure it worked
Access the settings with File/Settings. (There may be config files that could be edited as plain text, but here are the menu entries just to start.)
-
Editor/Code Style/[Language]/Tabs and Indents/Use tab character: Uncheck
-
Editor/Code Style/[Language]/Tabs and Indents/Tab Size: 4
-
Editor/Code Style/General/Line separator: Unix and macOS (\n)
-
Editor/General/Strip trailing spaces on save for: All
-
Editor/General/Ensure an empty line at the end of a file on Save: Checked
-
Editor/Code Style/[Language]/Code Generation/Comment Code/Line comment at first column: Uncheck
-
Editor/Code Style/[Language]/Code Generation/Comment Code/Block comment at first column: Uncheck
-
Editor/Code Style/[Language]/Code Generation/Comment Code/Add a space at comment start: Check