Code Style¶
This project automatically formats and checks (“lints”) the style of its source code and configuration files, using:
- EditorConfig for all files, configured in an
.editorconfig
- Google Java Style with
google-java-format
for*.java
- protolint for
*.proto
semantics - clang-format for
*.proto
and*.textproto
format - Buildifier for
BUILD.bazel
- DavidAnson/Markdownlint1 for
*.md
- Prettier for YAML & JSON & HTML & CSS & JS & TS (but not MD)
- ShellCheck for
*.bash
- Lucas-C/pre-commit-hooks to add missing license headers
There are pre-commit.com hooks for each of these tools configured in .pre-commit-config.yaml
.
Run the ./test.bash
script during local development to reformat changed files and re-run all tests affected by a change.
.git/hooks/pre-commit
will also run the ./test.bash
locally for each of your git commit
after you locally install it using tools/git/install-hooks.bash
.
Contributions by Pull Requests on GitHub are tested with the same ./test.bash
which is launched by this GitHub Action.
In-IDE, the plugins listed on our IDE page can be used.
-
DavidAnson/Markdownlint is not to be confused with markdownlint/markdownlint which was originally the inspiration for DavidAnson/Markdownlint but is now an unrelated separate project now has slightly different configuration. ↩