Giter Club home page Giter Club logo

checkstylesample's Introduction

CheckStyleSample

Auto scanning code for Java & Android

CheckStyle

CheckStyle Github

Feature

Checkstyle is highly configurable and can be made to support almost any coding standard. An example configuration files are supplied supporting the Sun Style, Google Style.

摘自 checkstyle.org

  • Auto 自动化 : 和 Git hook 结合无需手动点击触发,commit 前自动扫描。
  • Configurable 高可配: 检测规则可简可繁,Google 和 Sun 的几百种规则自由组合还可以自定义。
  • Cheap 低成本: 5 分钟配置,永久有效
  • Fast 每次对比上次 Git 变化的增量 Java 文件做检查,快速高效。
  • Adaptable 支持包含 Terminal Git 、 SourceTree 、AS Version Control 等任何形式的 Git 提交。

Install

20200109110836

  • Download check-style, Put your project root directory。

  • Terminal :

cp ./check-style/pre-commit ./.git/hooks   
chmod 777 ./.git/hooks/pre-commit    

uncheck

cp ./check-style/ignore_pre_commit/pre-commit ./.git/hooks  

Usage

  • Sample

20200109112536

  • Jump check

    git commit -n -m "say something"
  • Configuration of rules

Modify check-style/check-style.xml

Rule List

Rule for Chinese

20200109113315

Knowledge involved

  • Git
  • Shell or Python for script

FQA

fatal: cannot run .git/hooks/pre-commit: No such file or directory 

git commit 遇到这个问题请检查 studio 配置操作文件时候右下角的选项 注意是 LF 和 字符集,注意区分 Windows 和 Mac OS

Thanks

CheckStyle

https://www.jianshu.com/p/de90ffbd53e9

https://blog.csdn.net/cmmchenmm/article/details/82804267

https://www.jianshu.com/p/21d4cbe68a28

Git hook gives you a door, how big your brain hole is, how big the world behind the door will be

checkstylesample's People

Contributors

13120241790 avatar

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.