https://github.com/cristianoliveira/java-checkstyle
Git pre commit checkstyle java linter plugin
https://github.com/cristianoliveira/java-checkstyle
Last synced: 6 months ago
JSON representation
Git pre commit checkstyle java linter plugin
- Host: GitHub
- URL: https://github.com/cristianoliveira/java-checkstyle
- Owner: cristianoliveira
- License: mit
- Created: 2015-09-17T17:30:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-02-04T09:06:15.000Z (over 7 years ago)
- Last Synced: 2025-03-29T17:51:12.449Z (6 months ago)
- Language: Ruby
- Homepage:
- Size: 7.84 MB
- Stars: 33
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## Java - Pre-Commit Checkstyle
[](https://badge.fury.io/rb/java-checkstyle)
[](https://travis-ci.org/cristianoliveira/java-checkstyle)
[](https://codeclimate.com/github/cristianoliveira/java-checkstyle)
[](https://codeclimate.com/github/cristianoliveira/java-checkstyle/coverage)Useful git pre-commit hook for linting Java code.
It uses as default [The Google Style Guide](https://google.github.io/styleguide/javaguide.html)
and the famous [Checkstyle](http://checkstyle.sourceforge.net/) linter as a plugin for [pre-commit](https://github.com/jish/pre-commit).## Demo

[Don't you know who is Leeroy Jenkins?](https://www.youtube.com/watch?v=mLyOj_QD4a4)## Installation
First install the gems.
#### Pre-Commit Checkstylegem install pre-commit
#### Java Checkstyle Plugin
gem install java-checkstyle
##### (optional) If you use RVM
Take a look here [Install with RVM](https://github.com/jish/pre-commit#rvm)### Configuring
Use the pre-commit command to generate a stub pre-commit hook.
Inside folder of your git repo:```bash
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
``` bash
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](https://github.com/cristianoliveira/java-checkstyle/blob/master/DETAILED_TUTORIAL.md)---
## Checkstyle Guide
It uses as default [The Google Style Guide](https://google.github.io/styleguide/javaguide.html).
## Tests
Running tests with rspecMake sure you have been executed:
```bash
bundle install
```
Then run:```bash
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
``` bash
bundle exec rake ci
```*Pull request should have Unit Tests*
## Authors:
- Allen Madsen (Original Version 0.0.1)
- Alex Rocha
- Cristian Oliveira