Skip to content

Commit 2009be5

Browse files
author
Amanda Butler
authored
Merge pull request #400 from 0xc0170/dev_astyle
AStyle update (use options and ignore file for astyle)
2 parents 06780a0 + 94b1724 commit 2009be5

File tree

1 file changed

+10
-6
lines changed
  • docs/reference/contributing/guidelines

1 file changed

+10
-6
lines changed

docs/reference/contributing/guidelines/style.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ Whether you're writing new code or fixing bugs in existing code, please follow t
1414

1515
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).
1616

17+
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.
18+
19+
You can use [Artistic Style (AStyle)](http://sourceforge.net/projects/astyle/files/) to format your code. Use the command-line switch to select the correct style and point to the file you want to edit:
20+
21+
```
22+
astyle -n --options=.astylerc $(full_path_to_file)
23+
```
24+
25+
File `.astylerc` defines Mbed OS code style and it's located in Mbed OS root directory.
26+
1727
##### Code sample
1828

1929
```c
@@ -156,12 +166,6 @@ typedef struct analogin_s analogin_t;
156166

157167
All functions and methods should contain documentation using Doxgyen.
158168

159-
You can use [Artistic Style (AStyle)](http://sourceforge.net/projects/astyle/files/) to format your code. Use the command-line switch to select the correct style and point to the file you want to edit:
160-
161-
```
162-
astyle.exe --style=kr --indent=spaces=4 --indents-switches $(full_path_to_file)
163-
```
164-
165169
#### Compiler settings
166170

167171
All C and C++ code submitted to Mbed OS must compile with GCC Arm Embedded, Arm Compiler 5 and IAR EWARM. Mbed OS:

0 commit comments

Comments
 (0)