From 0c839e5359f1c628460ef01890451d4af0ed10ac Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Wed, 7 Feb 2018 10:57:38 +0000 Subject: [PATCH 1/6] AStyle: do not use .exe (multiplatform) --- docs/reference/contributing/guidelines/style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/contributing/guidelines/style.md b/docs/reference/contributing/guidelines/style.md index b239d65f91..c29b67f3b9 100644 --- a/docs/reference/contributing/guidelines/style.md +++ b/docs/reference/contributing/guidelines/style.md @@ -159,7 +159,7 @@ All functions and methods should contain documentation using Doxgyen. 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: ``` -astyle.exe --style=kr --indent=spaces=4 --indents-switches $(full_path_to_file) +astyle --style=kr --indent=spaces=4 --indents-switches $(full_path_to_file) ``` #### Compiler settings From fc7938717567407e9ff5e9a2a1a5cdf4c248b0a5 Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Wed, 7 Feb 2018 11:00:17 +0000 Subject: [PATCH 2/6] AStyle: add .astylerc options file --- docs/reference/contributing/guidelines/style.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference/contributing/guidelines/style.md b/docs/reference/contributing/guidelines/style.md index c29b67f3b9..5ac5245603 100644 --- a/docs/reference/contributing/guidelines/style.md +++ b/docs/reference/contributing/guidelines/style.md @@ -159,9 +159,11 @@ All functions and methods should contain documentation using Doxgyen. 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: ``` -astyle --style=kr --indent=spaces=4 --indents-switches $(full_path_to_file) +astyle -n --options=.astylerc $(full_path_to_file) ``` +File `.astylerc` defines Mbed OS code style and it's located in Mbed OS root directory. + #### Compiler settings All C and C++ code submitted to Mbed OS must compile with GCC Arm Embedded, Arm Compiler 5 and IAR EWARM. Mbed OS: From 58b553702ac12ceea04dbc647ae9de057203b158 Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Wed, 7 Feb 2018 11:01:48 +0000 Subject: [PATCH 3/6] Style: add .astyleignore file --- docs/reference/contributing/guidelines/style.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/contributing/guidelines/style.md b/docs/reference/contributing/guidelines/style.md index 5ac5245603..d5d2e992c6 100644 --- a/docs/reference/contributing/guidelines/style.md +++ b/docs/reference/contributing/guidelines/style.md @@ -14,6 +14,8 @@ Whether you're writing new code or fixing bugs in existing code, please follow t 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). +The only exception to this coding style are 3rd parties libraries. The 3rd party libraries should be added to the `.astyleignore` file located in the Mbed OS root directory. + ##### Code sample ```c From 6448e72b9dda544e204d3b80fa96e4aff4672b6f Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Wed, 7 Feb 2018 11:18:25 +0000 Subject: [PATCH 4/6] style: astyle to the coding style paragraph --- docs/reference/contributing/guidelines/style.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/reference/contributing/guidelines/style.md b/docs/reference/contributing/guidelines/style.md index d5d2e992c6..4969c5a765 100644 --- a/docs/reference/contributing/guidelines/style.md +++ b/docs/reference/contributing/guidelines/style.md @@ -16,6 +16,14 @@ Mbed OS follows the [K&R style](https://en.wikipedia.org/wiki/Indent_style#K.26R The only exception to this coding style are 3rd parties libraries. The 3rd party libraries should be added to the `.astyleignore` file located in the Mbed OS root directory. +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: + +``` +astyle -n --options=.astylerc $(full_path_to_file) +``` + +File `.astylerc` defines Mbed OS code style and it's located in Mbed OS root directory. + ##### Code sample ```c @@ -158,14 +166,6 @@ typedef struct analogin_s analogin_t; All functions and methods should contain documentation using Doxgyen. -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: - -``` -astyle -n --options=.astylerc $(full_path_to_file) -``` - -File `.astylerc` defines Mbed OS code style and it's located in Mbed OS root directory. - #### Compiler settings All C and C++ code submitted to Mbed OS must compile with GCC Arm Embedded, Arm Compiler 5 and IAR EWARM. Mbed OS: From a13c81a08768730b734ea96cfe62914ab6814c40 Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Wed, 7 Feb 2018 11:21:30 +0000 Subject: [PATCH 5/6] style: fix third-party code mention --- docs/reference/contributing/guidelines/style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/contributing/guidelines/style.md b/docs/reference/contributing/guidelines/style.md index 4969c5a765..26ee747ddf 100644 --- a/docs/reference/contributing/guidelines/style.md +++ b/docs/reference/contributing/guidelines/style.md @@ -14,7 +14,7 @@ Whether you're writing new code or fixing bugs in existing code, please follow t 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). -The only exception to this coding style are 3rd parties libraries. The 3rd party libraries should be added to the `.astyleignore` file located in the Mbed OS root directory. +The only exception to this coding style are third-party code. Third-party code should be added to the `.astyleignore` file located in the Mbed OS root directory. 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: From 94b1724cb6087a5b9962836d898cf4344d0f93eb Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Tue, 1 May 2018 17:37:53 -0500 Subject: [PATCH 6/6] Update style.md Add requested change from comment. --- docs/reference/contributing/guidelines/style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/contributing/guidelines/style.md b/docs/reference/contributing/guidelines/style.md index 26ee747ddf..1ee33fc427 100644 --- a/docs/reference/contributing/guidelines/style.md +++ b/docs/reference/contributing/guidelines/style.md @@ -14,7 +14,7 @@ Whether you're writing new code or fixing bugs in existing code, please follow t 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). -The only exception to this coding style are third-party code. Third-party code should be added to the `.astyleignore` file located in the Mbed OS root directory. +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. 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: