Code Monkey home page Code Monkey logo

customlintrules's Introduction

Custom Lint Rules

给Douyu小伙伴写的自定义Lint工具规则仓库,依赖Lint实现代码提示,可用于团队内统一代码规范。

使用

拉代码

git clone https://github.com/XF-zhjnc/CustomLintRules.git
cd CustomLintRules

在示例项目执行lint

./gradlew :app:lint

Modules介绍

  1. checks

一个Java library,需要新增Lint规则在这里新建Detector编写,并在DYLintRuleRegistry注册ISSUE

  1. lib_dylint

一个Android library,:checks生成的jar直接复制到AS指定的lint规则目录下,即可将编写的规则应用到全部的项目,若只希望在特定项目生效,则有了此lib,lintPublish将jar打包进aar。修改了checks中的规则后,重新编译此lib生成aar并发布。

  1. sample_app

示例app,依赖:lib_dylint,在这里检查lint效果。

自定义Lint规则

  • Lint API 文档

  • AS Settings -> Editor -> Inspections -> Android -> Lint查看谷歌编写的Lint规则,可以在com.android.tools.lint:lint-checks@aar找到这些Detector的具体实现。

customlintrules's People

Contributors

xeemoo avatar

Watchers

 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.