Skip to content

Adding a test with vera++ for Travis CI#63

Open
ghost wants to merge 1 commit into
masterfrom
unknown repository
Open

Adding a test with vera++ for Travis CI#63
ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Oct 13, 2016

Copy link
Copy Markdown

No description provided.

@brarcher

Copy link
Copy Markdown
Contributor

My understanding is that vera++ helps enforce style guidelines, correct? I like the idea.

Can you help me by providing a description of the different arguments you propose? Are there any other arguments which would help enforce the style that are not being proposed?

@ghost

ghost commented Oct 20, 2016

Copy link
Copy Markdown
Author

Vera++ is a programmable tool for verification, analysis and transformation of
C++ source code.

But it works well for C.

I did not know how to explain the options in the file for Travis CI. I explained the options I use in one of my project:

cmd='vera++ --error'
cmd="$cmd -R F001" # source files should not use the '\r' (CR) character
cmd="$cmd -R F002 -P max-filename-length=40"
cmd="$cmd -R L004 -P max-line-length=90"
cmd="$cmd -R L005 -P max-consecutive-empty-lines=2"
cmd="$cmd -R L006 -P max-file-length=700"
cmd="$cmd -R T001" # one-line comments should not have forced continuation
cmd="$cmd -R T004" # some keywords should be immediately followed by a colon
cmd="$cmd -R T005" # break and continue followed by a semicolon
cmd="$cmd -R T007" # semicolons not isolated by spaces or comments
cmd="$cmd -R T009" # ", " is right and " ," is wrong
cmd="$cmd -R T019" # control structures with complete curly-braced block

That is the documentation for the options: https://bitbucket.org/verateam/vera/wiki/Rules
You can also create your own rule(s): https://bitbucket.org/verateam/vera/wiki/ScriptAPI

@brarcher

Copy link
Copy Markdown
Contributor

It has been awhile, but when this change was attempted Travis CI could not find the vera++ command:

/home/travis/build.sh: line 45: vera++: command not found

Are you interested in investigating this further? Or, if not, would you like to contribute the C changes you have to Check without the vera++ support?

@ghost ghost mentioned this pull request Dec 14, 2016
@mikkoi

mikkoi commented Sep 23, 2019

Copy link
Copy Markdown
Contributor

For enforcing a certain style, astyle might be a better alternative.

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