@@ -25,9 +25,7 @@ the "MirageOS quality levels". Ideally this will live in a tool (e.g.
25
25
` mirage lint ` ) but to start we list the criteria that package aiming
26
26
for increased quality should follow.
27
27
28
- ### Level 1: Follow Packaging Guidelines
29
-
30
- ![ level-1] ( https://img.shields.io/badge/level-1-blue.svg )
28
+ ### ![ Level 1:] ( https://img.shields.io/badge/level-1-blue.svg ) Follow Packaging Guidelines
31
29
32
30
See the [ packaging guidelines] ( https://mirage.io/wiki/packaging ) for more
33
31
details. In summary:
@@ -52,9 +50,7 @@ details. In summary:
52
50
and could break the package in the future if one of a transitive dependency
53
51
is updated) (NOTE: should probably be added in the packaging guideline)
54
52
55
- ### Level 2: Define Package Scope
56
-
57
- ![ level-2] ( https://img.shields.io/badge/level-2-blue.svg )
53
+ ### ![ Level 2] ( https://img.shields.io/badge/level-2-blue.svg ) Define Package Scope
58
54
59
55
- Have well-identified maintainers. GitHub recently
60
56
[ introduced code owners] ( https://github.com/blog/2392-introducing-code-owners ) ,
@@ -67,19 +63,15 @@ details. In summary:
67
63
68
64
- Have documentation
69
65
70
- ### Level 3: Use Good Coding Style
71
-
72
- ![ level-3] ( https://img.shields.io/badge/level-3-blue.svg )
66
+ ### ![ Level 3:] ( https://img.shields.io/badge/level-3-blue.svg ) Use Good Coding Style
73
67
74
68
- Have proper indentation (using ocp-indent + checked-in ocp-indent file).
75
69
76
70
- Use at most 80 columns (` ocp-indent ` unfortunately doesn't check this).
77
71
78
72
- Follow [ OCaml programming guidelines] ( https://ocaml.org/learn/tutorials/guidelines.html ) .
79
73
80
- ### Level 4: Keep your Style Functional
81
-
82
- ![ level-4] ( https://img.shields.io/badge/level-4-blue.svg )
74
+ ### ![ Level 4:] ( https://img.shields.io/badge/level-4-blue.svg ) Keep your Style Functional
83
75
84
76
- Avoid global mutable state.
85
77
@@ -90,15 +82,11 @@ details. In summary:
90
82
- Avoid polymorphic equality and comparison -- when possible define your own
91
83
specialized functions.
92
84
93
- ### Level 5: Test
94
-
95
- ![ level-5] ( https://img.shields.io/badge/level-4-blue.svg )
85
+ ### ![ Level 5:] ( https://img.shields.io/badge/level-4-blue.svg ) Test
96
86
97
87
- Have unit tests (using alcotest) (ideally with coverage report).
98
88
99
- ### Level 6: Sane Dependencies
100
-
101
- ![ level-6] ( https://img.shields.io/badge/level-6-blue.svg )
89
+ ### ![ Level 6:] ( https://img.shields.io/badge/level-6-blue.svg ) Keep Sane Dependencies
102
90
103
91
- Depends only on libraries released in opam.
104
92
@@ -123,26 +111,20 @@ details. In summary:
123
111
improve performance by an order of magnitude, or re-use an existing C library
124
112
that has not been rewritten yet.
125
113
126
- ### Level 7: Randomized Test
127
-
128
- ![ level-7] ( https://img.shields.io/badge/level-7-blue.svg )
114
+ ### ![ Level 7:] ( https://img.shields.io/badge/level-7-blue.svg ) Randomized Test
129
115
130
116
- Have randomized property-based testing. Using QuickCheck-like libraries or
131
117
even better using fuzz testing (and crowbar) when the tooling will be ready.
132
118
133
- ### Level 8: Count with Care
134
-
135
- ![ level-8] ( https://img.shields.io/badge/level-8-blue.svg )
119
+ ### ![ Level 8:] ( https://img.shields.io/badge/level-8-blue.svg ) Count with Care
136
120
137
121
- Avoid integer overflows (basically every addition and subtraction, as well
138
122
as multiplication needs to be guarded unless you know that an overflow can
139
123
never happen (in this case, a comment should be suggested))
140
124
141
125
- Work on 32bit (esp. in regards to the last point)
142
126
143
- ### Level 9: Used in Production
144
-
145
- ![ level-9] ( https://img.shields.io/badge/level-9-blue.svg )
127
+ ### ![ Level 9:] ( https://img.shields.io/badge/level-9-blue.svg ) Used in Production
146
128
147
129
- Have a clear indication if the library is used in production (and if yes by
148
130
which project).
@@ -151,8 +133,6 @@ details. In summary:
151
133
needed to build the released version of the binary, for instance by vendoring
152
134
opam metadata.
153
135
154
- ### Level 10: Verify Formally
155
-
156
- ![ level-10] ( https://img.shields.io/badge/level-10-blue.svg )
136
+ ### ![ Level 10:] ( https://img.shields.io/badge/level-10-blue.svg ) Verify Formally
157
137
158
138
- Has been formally verified.
0 commit comments