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"
}
]