Skip to content

update style to pass ament_cpplint - #6

Merged
dirk-thomas merged 1 commit into
masterfrom
ament_cpplint_compliance
Oct 15, 2015
Merged

dirk-thomas merged 1 commit into
masterfrom
ament_cpplint_compliance

Conversation

@dirk-thomas

Copy link
Copy Markdown
Contributor

This patch updates the code to follow ament_cppling (which is essentially Google's style guide with some minor changes). We need to find a consensus if we want to use this as our style guide. E.g. the repeated includes in the cpp files are something which we currently don't do.

Connect to ament/ament_lint#31

@dirk-thomas dirk-thomas added the in review Waiting for review (Kanban column) label Oct 14, 2015
@dirk-thomas dirk-thomas self-assigned this Oct 14, 2015

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of this:

https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Names_and_Order_of_Includes

Is that you would not put #include <ament_index_cpp/visibility_control.h> ahead of #include <string>. Basically the only thing that goes ahead of system includes are matching header files for the current cpp file. Headers from the same package go last. Again as I see it, based on this example from their document:

// file: google-awesome-project/src/foo/internal/fooserver.cc
#include "foo/server/fooserver.h"

#include <sys/types.h>
#include <unistd.h>
#include <hash_map>
#include <vector>

#include "base/basictypes.h"
#include "base/commandlineflags.h"
#include "foo/server/bar.h"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree but couldn't get it to pass that way. Can you update this PR accordingly while still passing ament_cpplint?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll give it a shot.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the includes of non-system headers to use quotes instead of angled brackets. This makes cpplint happy.

@dirk-thomas
dirk-thomas force-pushed the ament_cpplint_compliance branch from 26db11b to ae74c3e Compare October 14, 2015 17:41
@wjwwood

wjwwood commented Oct 14, 2015

Copy link
Copy Markdown
Contributor

lgtm

@dirk-thomas
dirk-thomas force-pushed the ament_cpplint_compliance branch from ae74c3e to 5109f78 Compare October 14, 2015 22:09
dirk-thomas added a commit that referenced this pull request Oct 15, 2015
update style to pass ament_cpplint
@dirk-thomas
dirk-thomas merged commit 7804711 into master Oct 15, 2015
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Oct 15, 2015
@dirk-thomas
dirk-thomas deleted the ament_cpplint_compliance branch October 15, 2015 19:04
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