Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 13, 2016

No description provided.

@brarcher
Copy link
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
Copy link
Author

ghost commented Oct 20, 2016

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
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
Copy link
Contributor

mikkoi commented Sep 23, 2019

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