pre-commit

CI Check

If you turn on the ci check, it will look for and run a rake task called pre_commit:ci before each commit.

Example output:

$ git commit

pre-commit: your test suite has failed

for the full output run `pre_commit:ci`

 

You can bypass this check using `git commit -n`

Troubleshooting

$ git commit

pre-commit: skipping ci check. The `pre_commit:ci` task is not defined.

If you see a message like this, you need to define a rake task called pre_commit:ci.

If you're using test/unit you can point the pre_commit:ci task to run your test suite like this:

        namespace :pre_commit do
          task :ci => [:test]
        end
      

Or you can define your own custom pre_commit:ci task. This could, for example, run a small test suite of core tests. This small test suite should run very quickly. Remember, you're going to be running this test before every commit.