Skip to content

Commit 6d24885

Browse files
Add style and technical guidelines for SIG Scheduling
1 parent 5d54720 commit 6d24885

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

sig-scheduling/CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,26 @@ to the issue/PR, which helps to preserve the context.
7272

7373
* Always open an issue for a TODO or a follow-up just in case you forget it.
7474

75+
### Technical and style guidelines
76+
77+
The following guidelines apply primarily to kube-scheduler, but some subprojects
78+
might also adhere to them.
79+
80+
- Follow [effective go](https://go.dev/doc/effective_go) guidelines.
81+
- Naming:
82+
- Length: As a rule-of-thumb, the length of a variable name should be
83+
proportional to the size of the scope where it is used and inversely
84+
proportional to the number of times that it is used.
85+
- In tests:
86+
- Follow a [DAMP principle](https://stackoverflow.com/a/11837973).
87+
- Use `cmp.Diff` instead of `reflect.Equal`, to provide useful comparisons.
88+
- Avoid creating or using assertion libraries.
89+
Use standard `t.Error` or `t.Fatal`, as necessary.
90+
91+
Note that some existing code might be in violation of these guidelines, as it
92+
might have been written before these guidelines were established. Feel free to
93+
open PRs to get the code up to the standard.
94+
7595
## Use of @mentions
7696

7797
* @kubernetes/sig-scheduling-api-reviews - API Changes and Reviews

0 commit comments

Comments
 (0)