This is a collection of Luminar's development tools. These tools are used to help developers in their day-to-day tasks.
- Tools
- Hooks
check-build-file-without-extensions
check-snake-case
check-cpp-and-cu-unit-test-naming-pattern
check-no-dashes
check-sys-path-append
go-fmt
go-imports
go-revive
check-number-of-lines-count
check-shellscript-set-options
check-jira-reference-in-todo
check-non-existing-and-duplicate-excludes
check-ownership
- Contributing
If you want to debug C++ Bazel targets in VS Code, you can use configure-vscode-for-bazel
to generate a .vscode/launch.json
file.
This file then contains all targets for debugging in VS Code.
To generate a defined set of targets, run
configure-vscode-for-bazel //path/to/your/target/...
This will be forwarded to a bazel query
listing all cc_binary
and cc_test
targets.
Make sure you compile with debug symbols (--compilation_mode=dbg
) enabled.
whoowns
is a tool to print the GitHub codeowner of a folder or file by parsing the .github/CODEOWNERS
file.
With this tool, you can easily find out who is responsible for a specific part of the codebase from the terminal.
To find the owners of a file or folder, run
whoowns path/to/your/file/or/folder
# example output
# path/to/your/file/or/folder -> @owner1
Specify the --level N
to see the owners of child items in the N-th directory level below your provided folder.
Check that BUILD
files have a .bazel
ending. BUILD.bazel
file is the recommended way to name these files.
Check that all source code files are snake_case
. We don't want to use camelCase
or kebab-case
file names.
Check that all C++ and Cuda unit test files end with _test.cpp
or _test.cu
.
Check that markdown filenames do not use dashes
Check that no sys.path.append
is used in Python code
Format go files
Order go imports
Run Go Revive linter
Check that number of lines in scripts do not exceed max-lines. Use --max-lines=<number>
to set the maximum number of lines. Default is 30 for shell scripts.
Check if options are set with set -euxo pipefail
. Use # nolint(set_options)
to ignore this check.
Check that all TODO comments follow the same pattern and link a Jira ticket: TODO(ABC-1234):
.
Check for non existing and duplicate paths in .pre-commit-config.yaml
. Background: In a big codebase, the exclude lists can be quite long and it's easy to make a typo or forget to remove an entry when it's no longer needed.
Check if all folders in the CODEOWNERS
file exist, there are no duplicates, and it has acceptable codeowners.
What is an acceptable codeowner? We want to make sure that every folder has a codeowner other than the team that should exclusively own the CODEOWNERS file.
For this, we define a CODEOWNERS_OWNER
using the --codeowners-owner
argument. Your CODEOWNERS
file should look as follows:
* CODEOWNERS_OWNER
# Here goes all your CODEOWNERS file content overriding the wildcard owner
# leave this at the bottom to have highest ownership priority
/.github/CODEOWNERS CODEOWNERS_OWNER
If the hook detects CODEOWNERS_OWNER
owns anything else than .github/CODEOWNERS
it will fail to make sure every file added has an acceptable codeowner.
Please refer to the CONTRIBUTING.md file for information on how to contribute to this project.