source: EcnlProtoTool/trunk/mruby-2.1.1/CONTRIBUTING.md@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

File size: 2.7 KB
Line 
1# How to contribute
2
3mruby is an open-source project which is looking forward to each contribution.
4
5## Your Pull Request
6
7To make it easy to review and understand your change please keep the following
8things in mind before submitting your pull request:
9
10* Work on the latest possible state of **mruby/master**
11* Create a branch which is dedicated to your change
12* Test your changes before creating a pull request (```rake test```)
13* If possible write a test case which confirms your change
14* Don't mix several features or bug-fixes in one pull request
15* Create a meaningful commit message
16* Explain your change (i.e. with a link to the issue you are fixing)
17* Use mrbgem to provide non ISO features (classes, modules and methods) unless
18 you have a special reason to implement them in the core
19
20## Coding conventions
21
22How to style your C and Ruby code which you want to submit.
23
24### C code
25
26The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is
27written in the C programming language. Please note the following hints for your
28C code:
29
30#### Comply with C99 (ISO/IEC 9899:1999)
31
32mruby should be highly portable to other systems and compilers. For this it is
33recommended to keep your code as close as possible to the C99 standard
34(http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf).
35
36Although we target C99, we've heard some compilers in the embedded environment
37still requires declarations of local variables to be at the beginning of a
38scope. Until we confirm the situation has changed, we use the old-style
39variable declaration.
40
41Visual C++ is also an important target for mruby (supported version is 2013 or
42later). For this reason features that are not supported by Visual C++ may not
43be used (e.g. `%z` of `strftime()`).
44
45NOTE: Old GCC requires `-std=gnu99` option to enable C99 support.
46
47#### Reduce library dependencies to a minimum
48
49The dependencies to libraries should be kept to an absolute minimum. This
50increases the portability but makes it also easier to cut away parts of mruby
51on-demand.
52
53#### Don't use C++ style comments
54
55 /* This is the preferred comment style */
56
57Use C++ style comments only for temporary comment e.g. commenting out some code lines.
58
59#### Insert a break after the method return value:
60
61 int
62 main(void)
63 {
64 ...
65 }
66
67### Ruby code
68
69Parts of the standard library of mruby are written in the Ruby programming
70language itself. Please note the following hints for your Ruby code:
71
72#### Comply with the Ruby standard (ISO/IEC 30170:2012)
73
74mruby is currently targeting to execute Ruby code which complies to ISO/IEC
7530170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).
Note: See TracBrowser for help on using the repository browser.