Skip to content

Uncrustify configuration - #513

Draft
TimothyClaeys wants to merge 1 commit into
developfrom
develop_FW-881
Draft

Uncrustify configuration#513
TimothyClaeys wants to merge 1 commit into
developfrom
develop_FW-881

Conversation

@TimothyClaeys

Copy link
Copy Markdown
Member

This PR adds the uncrustify configuration file.

You can install the uncrustify binary on Mac OSX, Linux and Windows

  • Linux: sudo apt install uncrustify
  • Mac OS: brew install uncrustify
  • Windows: download from uncrustify

Alternatively you can clone the repo and compile the project yourself (latest version)

To run it on your code use:
uncrustify -c uncrustify-openwsn.cfg -f $FilePath -o $FilePath (makes the changes in-place)

I've applied the configuration to a bunch of files in the firmware project and I think the resulting layout looks nice, is properly aligned, and most importantly, improves code readability.

There are a lot of configuration options (700+) and they are all listed here: . Some options seem to override other ones. The latter can sometimes lead to weird formatting. I tried my best to remove contradicting configuration options, but it is possible some remain.

Before we reformat the entire FW repo, I propose that the people who are developing firmware code first try the uncrustify configuration on their local working trees and see if the configuration makes sense (and if they personally agree with the proposed code layout). If we see that it works well on all the files and we've converged on a fixed code layout/style, we can reformat the entire project once. Next, we can add the uncrustify configuration to the Travis builder to enforce future PRs to adhere to the coding style.

@TimothyClaeys

TimothyClaeys commented Nov 30, 2020

Copy link
Copy Markdown
Member Author

Hi @kyh-ly, I don't think the branch openwsn_FW-881-nrf52840dk is actively maintained at the moment. This is probably why it is broken and does not work with the current version of openvisualizer. Please, in the future, if you have a problem, open a github issue and do not use unrelated PR to ask questions.

@kyh-ly

kyh-ly commented Dec 1, 2020

Copy link
Copy Markdown

@TimothyClaeys Sorry I don't have access to open issues, please tell me how to do this. 😄

@TimothyClaeys

TimothyClaeys commented Dec 1, 2020

Copy link
Copy Markdown
Member Author

@kyh-ly Sorry, apparently, the issues tab was disabled. I enabled it now. If you go the repository's main page:

openwsn-fw

You should now see an Issues tab. Can you open an new issue there for your problem with the NRF52840, and any new issues you might encounter in the future. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants