Giter Club home page Giter Club logo

java-checkstyle's Introduction

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

java-checkstyle's People

Contributors

cristianoliveira avatar blatyo avatar alexrochas avatar drei01 avatar noahd1 avatar

Stargazers

Moritz Reiter avatar Falko Willers avatar Harish Ramanathan avatar kamxiao avatar Jirawat Boonkumnerd avatar Arda Güney avatar Loki avatar Pável Kalmykov Razgovórov avatar Greg Bintz avatar Tait avatar Tarik Sturm avatar Kanyinsola Fapohunda avatar Eric Yang avatar Lingaraj avatar Minkyu Cho avatar Eder Ferreira avatar 葛俊 avatar Evan Conrad avatar Thomas Darimont avatar Harvey Bai avatar Kevin He avatar  浩码农 avatar JiangNan avatar  avatar Andrii Mishkovskyi avatar  avatar Jarek Strzelecki avatar Andy Gherna avatar  avatar Matthew Clarke avatar Erik Haugrud avatar Olle Törnström avatar  avatar

Watchers

 avatar Harvey Bai avatar John avatar  avatar

java-checkstyle's Issues

Demo in English

Hello guys.
I noticed that the demo picture is in another language (pt-br?)... Could you provide an english version?

Add support for a custom checkstyle.xml

We need add this support, if you see, often we need to check things that are not on sun-checks.xml.
Instead of let each IDE do this, java-checkstyle could do this for us.

What do you think? ;)

Can't install plugin

WhenEvery time I execute a commit I'm getting the following message:

ould not find plugin supporting checkstyle / Checkstyle,
available plugins: BeforeAll, Ci, Coffeelint, Common, ConsoleLog, Csslint, Debugger, GemfilePath, Go, GoBuild, GoFmt, Jshint, Jslint, Json, Local, MergeConflict, Migration, NbSpace, Pry, Rails, RspecFocus, Rubocop, Ruby, RubySymbolHashrockets, ScssLint, Tabs, Whitespace, Yaml

Happy to help to figure out the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.