Skip to content

Commit

Permalink
Initial list of best practices to follow in our project (#1925)
Browse files Browse the repository at this point in the history
* Initial list of best practices to follow in our project

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: John Watson <jkwatson@gmail.com>

* Update CONTRIBUTING.md

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

Co-authored-by: John Watson <jkwatson@gmail.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
  • Loading branch information
3 people authored Oct 31, 2020
1 parent d00d50c commit 75d87f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ which uses [google-java-format](https://github.com/google/google-java-format) li

`./gradlew spotless`

### Best practices that we follow

* Avoid exposing publicly any class/method/variable that don't need to be public.
* By default, all arguments/members are treated as non-null. Every argument/member that can be `null` must be annotated with `@Nullable`.
* The project aims to provide a consistent experience across all the public APIs. It is important to ensure consistency (same look and feel) across different public packages.
* Use `final` for public classes everywhere it is possible, this ensures that these classes cannot be extended when the API does not intend to offer that functionality.

If you notice any practice being applied in the project consistently that isn't listed here, please consider a pull request to add it.

### Pre-commit hook
To completely delegate code style formatting to the machine,
you can add [git pre-commit hook](https://git-scm.com/docs/githooks).
Expand Down

0 comments on commit 75d87f4

Please sign in to comment.