Android静态代码检查-使用Detekt保持代码库整洁

At Livefront, we’ve taken an initiative in the last year to reduce cognition spent on tasks that can be automated to save our brainwaves for the difficult tasks that count. By automating weekly releases, implementing coverage reporting on our core application logic, and bolstering our usage of static code checks, we’ve made our engineers happier and our codebases cleaner!

Livefront ,我们在去年采取了一项主动行动,以减少人们对可自动执行的任务的认知,从而节省了脑力,以应对难以计数的困难任务。 通过使每周的发布自动化,在我们的核心应用程序逻辑上实现覆盖率报告以及增强对静态代码检查的使用,我们使工程师更快乐,代码库更清洁!

In this article we’ll focus on setting up detekt, a Kotlin specific linting tool that can enforce codebase documentation, give hints about code blocks that are getting a bit complicated, enforce formatting standards, and sniff out potential bugs before they hatch! Here’s how to get up and running:

在本文中,我们将集中于设置detekt ,这是Kotlin特定的linting工具,可以执行代码库文档,提供有关变得复杂的代码块的提示,强制执行格式标准,并在可能的bug出现之前就对其进行嗅探! 这是启动和运行的方法:

1)添加detekt gradle插件以构建/渐变¹: (1) Add the detekt gradle plugin to build/gradle¹:)

buildscript {
    // ...
    repositories {
        // ...
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        // ...
        classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.1.1"
    }
]

2)在应用程序级别build.gradle中引用该插件: (2) Refe

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值