From 4700dea92bf4ba8bb232f0475f2ca4d99e738941 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Fri, 4 Jun 2021 17:48:37 +0300 Subject: [PATCH] Pull request: all: imp hacking nav Merge in DNS/adguard-home from imp-hacking to master Squashed commit of the following: commit d15c1b304a4a003db22a8821e586f2d617f85d39 Author: Ainar Garipov Date: Fri Jun 4 17:43:11 2021 +0300 all: imp hacking nav --- HACKING.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/HACKING.md b/HACKING.md index 3090a182..83e8ac1b 100644 --- a/HACKING.md +++ b/HACKING.md @@ -21,16 +21,17 @@ The rules are mostly sorted in the alphabetical order. * [Recommended Reading](#recommended-reading) * [Markdown](#markdown) * [Shell Scripting](#shell-scripting) - * [Shell Conditionals](#shell-cond) + * [Shell Conditionals](#shell-conditionals) * [Text, Including Comments](#text-including-comments) * [YAML](#yaml) +on GitHub and most other Markdown renderers. Use both "id" and "name" +attributes to make it work in Markdown renderers that strip "id". --> -## Git +## Git * Call your branches either `NNNN-fix-foo` (where `NNNN` is the ID of the GitHub issue you worked on in this branch) or just `fix-foo` if there was no @@ -56,14 +57,14 @@ on GitHub and most other Markdown renderers. --> -## Go +## Go > Not Golang, not GO, not GOLANG, not GoLang. It is Go in natural language, > golang for others. — [@rakyll](https://twitter.com/rakyll/status/1229850223184269312) - ### Code + ### Code * Always `recover` from panics in new goroutines. Preferably in the very first statement. If all you want there is a log message, use `log.OnPanic`. @@ -163,7 +164,7 @@ on GitHub and most other Markdown renderers. --> * Write logs and error messages in lowercase only to make it easier to `grep` logs and error messages without using the `-i` flag. - ### Commenting + ### Commenting * See also the “[Text, Including Comments]” section below. @@ -194,7 +195,7 @@ on GitHub and most other Markdown renderers. --> } ``` - ### Formatting + ### Formatting * Decorate `break`, `continue`, `fallthrough`, `return`, and other function exit points with empty lines unless it's the only statement in that block. @@ -216,7 +217,7 @@ on GitHub and most other Markdown renderers. --> }} ``` - ### Naming + ### Naming * Don't use underscores in file and package names, unless they're build tags or for tests. This is to prevent accidental build errors with weird tags. @@ -278,7 +279,7 @@ on GitHub and most other Markdown renderers. --> } ``` - ### Testing + ### Testing * Use `assert.NoError` and `require.NoError` instead of `assert.Nil` and `require.Nil` on errors. @@ -286,7 +287,7 @@ on GitHub and most other Markdown renderers. --> * Use functions like `require.Foo` instead of `assert.Foo` when the test cannot continue if the condition is false. - ### Recommended Reading + ### Recommended Reading * . @@ -301,7 +302,7 @@ on GitHub and most other Markdown renderers. --> -## Markdown +## Markdown * **TODO(a.garipov):** Define more Markdown conventions. @@ -314,7 +315,7 @@ on GitHub and most other Markdown renderers. --> -## Shell Scripting +## Shell Scripting * Avoid bashisms and GNUisms, prefer POSIX features only. @@ -385,7 +386,7 @@ on GitHub and most other Markdown renderers. --> dir="${TOP_DIR}"/sub ``` - ### Shell Conditionals + ### Shell Conditionals Guidelines and agreements for using command `test`, also known as `[`: @@ -403,7 +404,7 @@ Guidelines and agreements for using command `test`, also known as `[`: -## Text, Including Comments +## Text, Including Comments * End sentences with appropriate punctuation. @@ -441,7 +442,7 @@ Guidelines and agreements for using command `test`, also known as `[`: -## YAML +## YAML * **TODO(a.garipov):** Define naming conventions for schema names in our OpenAPI YAML file. And just generally OpenAPI conventions.