summary refs log tree commit diff
path: root/CONTRIBUTING
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-02-11 18:11:46 +0100
committerMichael Biebl <biebl@debian.org>2021-02-11 18:11:46 +0100
commit80ec1decc49c72efec2a8b87c06245c92c0ab807 (patch)
treee3b229aa94e8dcf0590f2317664176e7b8f7607b /CONTRIBUTING
parent65f86e8f56267192d42f2b629fc6b0c99fb9cd0c (diff)
New upstream version 1.29.90 upstream/1.29.90
Diffstat (limited to 'CONTRIBUTING')
-rw-r--r--CONTRIBUTING55
1 files changed, 41 insertions, 14 deletions
diff --git a/CONTRIBUTING b/CONTRIBUTING
index c157614e..8335cbfd 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -1,32 +1,51 @@
 Guidelines for Contributing
 ===========================
 
+
 Coding Standard
 ---------------
 
-* The formatting uses clang-format with clang 11.0. Run
-  `./contrib/scripts/nm-code-format.sh -i` to reformat.
+The formatting uses clang-format with clang 11.0. Run
+`./contrib/scripts/nm-code-format.sh -i` to reformat the code
+or call `clang-format` yourself.
+You may also call `./contrib/scripts/nm-code-format-container.sh`
+which runs a Fedora 33 container using podman.
+You are welcome to not bother and open a merge request with
+wrong formatting, but note that we then will automatically adjust
+your contribution before merging.
+
+The automatic reformatting was done by commit 328fb90f3e0d4e35975aff63944ac0412d7893a5.
+Use `--ignore-rev` option or `--ignore-revs-file .git-blame-ignore-revs` to ignore
+the reformatting commit with git-blame:
+
+```
+$ git config --add 'blame.ignoreRevsFile' '.git-blame-ignore-revs'
+```
+
+Since our coding style is entirely automated, the following are just
+some details of the style we use:
 
 * Indent with 4 spaces. (_no_ tabs).
 
 * Have no space between the function name and the opening '('.
-    GOOD:  g_strdup(x)
-    BAD:  g_strdup (x)
+  - GOOD: `g_strdup(x)`
+  - BAD:  `g_strdup (x)`
 
 * C-style comments
-    GOOD: f(x);  /* comment */
-    BAD:  f(x);  // comment
+  - GOOD: `f(x);  /* comment */`
+  - BAD:  `f(x);  // comment`
 
 * Keep assignments in the variable declaration area pretty short.
-    GOOD: MyObject *object;
-    BAD: MyObject *object = complex_and_long_init_function(arg1, arg2, arg3);
+  - GOOD: `MyObject *object;`
+  - BAD:  `MyObject *object = complex_and_long_init_function(arg1, arg2, arg3);`
 
 * 80-cols is a guideline, don't make the code uncomfortable in order to fit in
   less than 80 cols.
 
 * Constants are CAPS_WITH_UNDERSCORES and use the preprocessor.
-    GOOD: #define MY_CONSTANT 42
-    BAD:  static const unsigned myConstant = 42;
+  - GOOD: `#define MY_CONSTANT 42`
+  - BAD:  `static const unsigned myConstant = 42;`
+
 
 Legal
 -----
@@ -40,6 +59,8 @@ Note that all new contributions to NetworkManager MUST be made under terms of
 LGPL-2.1+, that is also the case for parts that are currently licensed GPL-2.0+.
 The reason for that is that we might eventually relicense everything as LGPL and
 new contributions already must agree with that future change.
+For more details see [RELICENSE.md](RELICENSE.md).
+
 
 Assertions in NetworkManager code
 ---------------------------------
@@ -125,15 +146,21 @@ The notes it are called "refs/notes/bugs".
 
 So configure:
 
-  $ git config --add 'remote.origin.fetch' 'refs/notes/bugs:refs/notes/bugs'
-  $ git config --add 'notes.displayref' 'refs/notes/bugs'
+```
+$ git config --add 'remote.origin.fetch' 'refs/notes/bugs:refs/notes/bugs'
+$ git config --add 'notes.displayref' 'refs/notes/bugs'
+```
 
 For example, set notes with
 
-  $ git notes --ref refs/notes/bugs add -m "(cherry picked from $COMMIT_SHA)" HEAD
+```
+$ git notes --ref refs/notes/bugs add -m "(cherry picked from $COMMIT_SHA)" HEAD
+```
 
 You should see the notes in git-log output as well.
 
 To resync our local notes use:
 
-  $ git fetch origin refs/notes/bugs:refs/notes/bugs -f
+```
+$ git fetch origin refs/notes/bugs:refs/notes/bugs -f
+```