Repository navigation
Expand file tree
/
Copy pathfile.CONTRIBUTING.html
More file actions
146 lines (102 loc) · 4.96 KB
/
Copy pathfile.CONTRIBUTING.html
File metadata and controls
146 lines (102 loc) · 4.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
File: CONTRIBUTING
— Documentation by YARD 0.9.12
</title>
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="css/mruby.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
pathId = "CONTRIBUTING";
relpath = '';
</script>
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
<script type="text/javascript" charset="utf-8" src="js/mruby.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="file_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="_index.html">Index</a> »
<span class="title">File: CONTRIBUTING</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><div id='filecontents'><h1 id="how-to-contribute">How to contribute</h1>
<p>mruby is an open-source project which is looking forward to each contribution.</p>
<h2 id="your-pull-request">Your Pull Request</h2>
<p>To make it easy to review and understand your change please keep the following
things in mind before submitting your pull request:</p>
<ul>
<li>Work on the latest possible state of <strong>mruby/master</strong></li>
<li>Create a branch which is dedicated to your change</li>
<li>Test your changes before creating a pull request (<code>./minirake test</code>)</li>
<li>If possible write a test case which confirms your change</li>
<li>Don’t mix several features or bug-fixes in one pull request</li>
<li>Create a meaningful commit message</li>
<li>Explain your change (i.e. with a link to the issue you are fixing)</li>
<li>Use mrbgem to provide non ISO features (classes, modules and methods) unless
you have a special reason to implement them in the core</li>
</ul>
<h2 id="coding-conventions">Coding conventions</h2>
<p>How to style your C and Ruby code which you want to submit.</p>
<h3 id="c-code">C code</h3>
<p>The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is
written in the C programming language. Please note the following hints for your
C code:</p>
<h4 id="comply-with-c99-isoiec-98991999">Comply with C99 (ISO/IEC 9899:1999)</h4>
<p>mruby should be highly portable to other systems and compilers. For this it is
recommended to keep your code as close as possible to the C99 standard
(http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf).</p>
<p>Although we target C99, Visual C++ is also an important target for mruby. For
this reason a declaration of a local variable has to be at the beginning of a
scope block.</p>
<h4 id="reduce-library-dependencies-to-a-minimum">Reduce library dependencies to a minimum</h4>
<p>The dependencies to libraries should be kept to an absolute minimum. This
increases the portability but makes it also easier to cut away parts of mruby
on-demand.</p>
<h4 id="dont-use-c-style-comments">Don’t use C++ style comments</h4>
<pre class="code ruby"><code class="ruby"><span style="background-color:hsla(300,100%,50%,0.06)"><span style="color:#404">/</span><span style="color:#808">* This is the preferred comment style *</span><span style="color:#404">/</span></span>
</code></pre>
<p>Use C++ style comments only for temporary comment e.g. commenting out some code lines.</p>
<h4 id="insert-a-break-after-the-method-return-value">Insert a break after the method return value:</h4>
<pre class="code ruby"><code class="ruby">int
main(void)
{
...
}
</code></pre>
<h3 id="ruby-code">Ruby code</h3>
<p>Parts of the standard library of mruby are written in the Ruby programming
language itself. Please note the following hints for your Ruby code:</p>
<h4 id="comply-with-the-ruby-standard-isoiec-301702012">Comply with the Ruby standard (ISO/IEC 30170:2012)</h4>
<p>mruby is currently targeting to execute Ruby code which complies to ISO/IEC
30170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).</p>
</div></div>
<div id="footer">
Generated on Fri May 11 23:53:55 2018 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.12 in <a href="https://github.com/sagmor/yard-mruby">mruby mode</a> 0.3.0 (ruby-2.5.1).
</div>
</div>
</body>
</html>