Skip to content

Commit 450bbbe

Browse files
author
Amanda Butler
authored
Merge pull request #1066 from ARMmbed/style-review
Review edits to style.md
2 parents 2f8fe92 + 4be2d31 commit 450bbbe

File tree

1 file changed

+8
-7
lines changed
  • docs/reference/contributing/guidelines

1 file changed

+8
-7
lines changed

docs/reference/contributing/guidelines/style.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Style
22

3-
The Arm Mbed OS codebase is hosted on GitHub, and you can submit new features or bug fixes. Please follow the [guidelines for GitHub pull requests](#guidelines-for-github-pull-requests) and the [coding style guide](#coding-style) in your submissions.
3+
The Arm Mbed OS codebase is hosted on GitHub, and you can submit new features or bug fixes. Please follow the [guidelines for GitHub pull requests](../contributing/workflow.html#guidelines-for-github-pull-requests) and the [coding style guide](#coding-style) in your submissions.
44

55
<span class="tips">**Tip:** Please also read the [workflow](../contributing/workflow.html) section for a review of the process and legal requirements.</span>
66

@@ -12,7 +12,7 @@ After the code has gone through automated testing, developers will take a look a
1212

1313
Whether you're writing new code or fixing bugs in existing code, please follow the Mbed OS coding style.
1414

15-
Mbed OS follows the [K&R style](https://en.wikipedia.org/wiki/Indent_style#K.26R_style), with at least two exceptions (which can be found in the list below the code sample).
15+
Mbed OS follows the [K&R style](https://en.wikipedia.org/wiki/Indent_style#K.26R_style), with at least two exceptions (see [Rules](#rules)).
1616

1717
The only exception to this coding style involves third-party code. Third-party code should be added to the `.astyleignore` file located in the Mbed OS root directory.
1818

@@ -22,7 +22,7 @@ You can use [Artistic Style (AStyle)](http://sourceforge.net/projects/astyle/fil
2222
astyle -n --options=.astylerc $(full_path_to_file)
2323
```
2424

25-
File `.astylerc` defines Mbed OS code style and it's located in Mbed OS root directory.
25+
File `.astylerc` defines Mbed OS code style and it's in the Mbed OS root directory.
2626

2727
### Code sample
2828

@@ -67,6 +67,7 @@ uint32_t adc_function(analogin_t *obj, uint32_t options)
6767
return adc_hal_get_conversion_value(instance, 0);
6868
}
6969
```
70+
7071
### Rules
7172
7273
- Indentation - four spaces. Please do not use tabs.
@@ -105,13 +106,13 @@ uint32_t adc_function(analogin_t *obj, uint32_t options)
105106
106107
#### Classes
107108
108-
- Begins with a capital letter, and each word in it also begins with a capital letter (AnalogIn, BusInOut).
109+
- Begin with a capital letter, and each word within a class also begins with a capital letter (AnalogIn, BusInOut).
109110
110111
- Methods contain small letters, with words separated by underscore.
111112
112-
- Private members starts with an underscore: ``__User defined types (typedef)))``.
113+
- Private members start with an underscore: ``__User defined types (typedef)))``.
113114
114-
- Structures - `suffix _t` - to denote it is a user defined type.
115+
- Structures - `suffix _t` - to denote it is a user-defined type.
115116
116117
- Enumeration - the type name and values name - same naming convention as classes (for example MyNewEnum).
117118
@@ -121,7 +122,7 @@ uint32_t adc_function(analogin_t *obj, uint32_t options)
121122
122123
- Words separated by underscore (wait_ms, read_u16).
123124
124-
As an example:
125+
An example:
125126
126127
```cPP TODO
127128
#define ADC_INSTANCE_SHIFT 8

0 commit comments

Comments
 (0)