0.01
No commit activity in last 3 years
No release in over 3 years
Checkstyle linter plugin for pre-commit. Useful for linting Java code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 10.4.2, ~> 10.4
~> 3.3.0
~> 0.34.2

Runtime

~> 0.4.2
~> 0.26
 Project Readme

Java - Pre-Commit Checkstyle

Gem Version Build Status Code Climate Test Coverage

Useful git pre-commit hook for linting Java code.

It uses as default The Google Style Guide and the famous Checkstyle linter as a plugin for pre-commit.

Demo

My awesome change has been catch. Oh boy! Don't you know who is Leeroy Jenkins?

Installation

First install the gems.

Pre-Commit Checkstyle

gem install pre-commit

Java Checkstyle Plugin

gem install java-checkstyle
(optional) If you use RVM

Take a look here Install with RVM

Configuring

Use the pre-commit command to generate a stub pre-commit hook. Inside folder of your git repo:

pre-commit install

It will create a .git/hooks/pre-commit script which will check your git config and run checks that are enabled.

Enabling checks

pre-commit enable git checks checkstyle

Result

Every time you try to commit some java code with style errors it will validate for you ensuring that your code will be always awesome.


Detailed version to install.

Still don't work? Try the detailed version here


Checkstyle Guide

It uses as default The Google Style Guide.

Tests

Running tests with rspec

Make sure you have been executed:

bundle install

Then run:

rspec

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Codeclimate

Before push, make sure you have been executed rubocop

bundle exec rake ci

Pull request should have Unit Tests

Authors:

  • Allen Madsen (Original Version 0.0.1)
  • Alex Rocha
  • Cristian Oliveira