Skip to content

Instantly share code, notes, and snippets.

@garaemon
Created October 23, 2015 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garaemon/943555f9e8d0bf0521ae to your computer and use it in GitHub Desktop.
Save garaemon/943555f9e8d0bf0521ae to your computer and use it in GitHub Desktop.

Pull Request Title

Please write good title when you create a pull request. Do not use a title like update.

If you are not confident about wiring good title, follow template below:

[${package}/${program_name}] short description

We also recommend you to attach a picture in a pull request.

Commit log

jsk-ros-pkg repositories has a lot of packages in one repository. You must write easy-to-understand commit log.

Your commit log must be clear about

  1. Objective. Why needed.
  2. Which program?

If you are not confident about wiring good commit log, follow template below:

[${package}/${program_name}] short description

concrete description

Coding Style

Please follow other codes in the same package.

For reference, most of C++ code in jsk-ros-pkg follows style described below:

  • Use soft tab, do not use hard tab.

  • Keep 80-columns as much as possible.

  • Do not write using namespace ... in headers.

  • if

    if (test) {
      awesome_code
    }
    else if (test2) {
     awesome_code
    }
    else {
     awesome_code
    }
  • class

    class Foo: public class Bar
    {
      public:
        ...
      protected:
        bool fooBarBar();
        int foo_;
        int foo_bar_;
      private:
        ...
    };

    Class name should be camel-case and starting with upper case. Member variables is snake-case and should have _ suffix. Method should be camel-case and starting with lower case.

  • include guard

    #ifndef PACKAGE_NAME_HEADER_FILE_NAME_H_
    #define PACKAGE_NAME_HEADER_FILE_NAME_H_
    ...
    #endif
    
  • Function and method

    int foo() {
      int bar_bar = 0;
    }
    

    Local variables in a function should be snake-case.

  • Do not use pointer, use boost::shared_ptr

  • Do not use c++1x for old environment. Use boost.

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