39 lines
1.5 KiB
Markdown
39 lines
1.5 KiB
Markdown
# repository rules
|
|
|
|
* never use `git add -A` - add specific changes to a deliberate commit. a
|
|
commit should contain one change. after each change, make a commit with a
|
|
good one-line summary.
|
|
|
|
* NEVER modify the linter config without asking first.
|
|
|
|
* NEVER modify tests to exclude special cases or otherwise get them to pass
|
|
without asking first. in almost all cases, the code should be changed,
|
|
NOT the tests.
|
|
|
|
* when linting, assume the linter config is CORRECT, and that each item
|
|
output by the linter is something that legitimately needs fixing in the
|
|
code.
|
|
|
|
* when running tests, use `make test`.
|
|
|
|
* before commits, run `make check`. this runs `make lint` and `make test`
|
|
and `make check-fmt`. any issues discovered must be resolved before
|
|
committing unless explicitly told otherwise.
|
|
|
|
* when fixing a bug, write a failing test for the bug FIRST. add
|
|
appropriate logging to the test to ensure it is written correctly. commit
|
|
that. then go about fixing the bug until the test passes (without
|
|
modifying the test further). then commit that.
|
|
|
|
* when adding a new feature, do the same - implement a test first (TDD). it
|
|
doesn't have to be super complex. commit the test, then commit the
|
|
feature.
|
|
|
|
* when adding a new feature, use a feature branch. when the feature is
|
|
completely finished and the code is up to standards (passes `make check`)
|
|
then and only then can the feature branch be merged in to `main` and the
|
|
branch deleted.
|
|
|
|
* write godoc documentation comments for all exported types and functions as
|
|
you go along.
|