Branches should be named after either their developer or purpose. Branch names should be camel case and not contain any spaces, underscores (_), or dashes (-, except for in codespace names).
These branches are created for one change, followed by one pull request, and are typically deleted after merging.
Naming convention:
feature/<description>- code to add new functionalitybug/<description>- code to fix / improve existing functionalitychange/<description>- changes to things like documentation and meta / constants- or for anything else really
Examples:
feature/addNewListMethodsbug/fixHashListUnitTestschange/addContributingFile
These branches are used by individual developers or codespaces and sometimes have higher perms.
Naming convention:
user/<github username>user/codespace/<codespace name>
Use common sense when writing and arranging your code. Listed here are some generally expected practices for this repo, but if no particular rule is specified here just follow normal Java standards.
- Javadoc
classorinterfacestatementstaticvariablesfinalinstance variables- mutable instance variables
- constructors
- overriding methods
publicmethods- general purpose
privatemethods
publicmethods should generally be placed on the top half of classes, andprivatemethods should reside in the bottom half.- It is ok to mark
privatemethods asprotectedin order to individually unit test them
- It is ok to mark
privatemethods that are directly used by one or morepublicmethods for a single purpose may go under that method instead of at the bottom section.publicmethods that extend on the functionality of an overridden method (by overloading it, for example) may go under that method instead of in the public method section.- All
staticvariables should befinal. - No variables should be
publicunless it is a utility class and the variable isstatic final. Use getters and setters forprivatevariables.
- All class names should start with
Mtx - All subclass names should be written as:
Mtx+<name>+<super class name>- Example:
MtxArrayListandMtxStringListinheritMtxList
- Example:
- All utility class names should end with
Util- Example:
MtxTimeUtil
- Example:
Please add unit tests for all new functionality! This is a utility library so most code will not be user-tested unless it has unit tests. The goal is to maintain 95% code coverage. The only code that is not covered should be code that logistically cannot be tested or mocked!
- Unit test classes should be named:
<class name>+Test- Example:
MtxTimeUtilTestcontains the tests forMtxTimeUtil
- Example:
- Unit test methods should be named:
test+<method name>(capitalized) +_<testcase>(optional)- So basically just name all unit tests the same as the method being tested, prefixed by the word
test, in camel case. - If the method being tested needs multiple unit tests, name them all the same + the test case description, separated by an underscore (
_) - Example:
testAddAll_argContainingDelimiter()andtestAddAll_addToNonEmptyList()will test the methodaddAll() - If 3 or more tests are needed for one method then please put them in a nested testing class (Denoted with
@Nested)
- So basically just name all unit tests the same as the method being tested, prefixed by the word