Swarm-IITKgp / swarm_simulator

Simulator for Swarm, IIT Kharagpur on Gazebo
7 stars 25 forks source link

Git pre-commit hook for running cpplint #14

Closed abhinavjain241 closed 9 years ago

abhinavjain241 commented 9 years ago

Installation procedure is easy, go to swarm_simulator root directory and then run:

./scripts/git/install-pre-commit.sh

The typical process would be like:

Lets take a sample test file Test.cpp:

#include <iostream>

 int main()
 {
     std::cout<<"Hello CppLint!"<<std::endl;
     return 0;
 }

Add the files:

git_add

Commit them:

git_commit

If answer is y, then the commit will be conformed, otherwise a n will abort the commit.

Commit them along with --no-verify option:

commit_no_verify

You can always pass --no-verify to commit to bypass the pre-commit hook.

aa-dit-yuh commented 9 years ago

A better solution for maintaining code quality would be to setup Travis builds for each branch and PR that runs the above python script. It would also builds the entire package on different versions of ROS and run tests against them(if any).
About the PR:

abhinavjain241 commented 9 years ago

Yeah, that would be better. Thanks for the suggestion @narayanaditya95! And sorry about that, will stash the stray commit and then rebase.