我们以“ 3S质量因子”为代码以Theodo质量定义:
我们认为团队需要以下内容才能提供高质量的代码:
提利昂的目标是在最后一点帮助您“?能够衡量质量”。
我们将技术债务定义为防止质量的每条代码或架构。通过各种实验,我们看到,当我们监视技术债务的演变时,更有可能阻止其增加。过去,我们尝试了不同的方法来管理和测量它(Trello卡,Google Docs,Post-it,..),但是我们从未找到一种无痛的解决方案,可以让我们:
所以我们创建了提利昂。您现在可以:
您需要将Tyrion与节点V12或V14一起使用。它目前不使用卓越版本,主要是因为使用主要工具的问题:Nodegit。
全球安装Tyrion: npm i -g tyrionl
(是的,最终l
的tyrionl
,不是错字)。
使用以下选项运行tyrion
-p, --path [scanDirectory] The path of the directory you want to analyse
-e, --evolution [days] Get the evolution of the debt since X days
-b, --branch [days] Specify the branch used for the evolution analysis. (Default to master)
-n, --nobrowser [browser] Don't open the report after being generated
-c, --csv [csv] export the debt data into a csv file
-d, --devs [devs] Get information about who is contributing the most to quality (Beta)
-h, --help output usage information
例子:
tyrion -p ./src -c
获得当前的债务评分并创建CSV报告tyrion --evolution 28 -p .
从上一项提交开始,要在28天内获得债务的演变。tyrion --evolution 28 -b prod -p .
从POR分支机构的最后一个提交开始,要在28天内获得债务的演变。 您可以将以下债务标签用于相同的结果: @debt
, TODO
, FIXME
。
提利昂(Tyrion)解析了以下约定遵循的评论的文件:
/**
* @debt DEBT_TYPE:SUB_TYPE
*/
以下债务有默认分数:
您不需要指定sub_type,因此最少的示例可以是:
/**
* @debt quality
*/
您可以添加评论,以遵循此公约:
/**
* @debt DEBT_TYPE:SUB_TYPE "Author: comment"
*/
一个完整的例子可能是:
/**
* @debt security:sql-injection "Maximet: The request is not escaped when being called from the command"
*/
解析器将寻找包含“ @debt”的所有行,并以*
或#
开始,该行应涵盖大多数Web编程语言。
您可以通过在项目的根目录中创建.tyrion-config.json
文件来覆盖债务项目的默认定价。您甚至可以创建自己的类型。这是默认一个:
{
"pricer": {
"bug": 100,
"architecture": 100,
"bugRisk": 5,
"security": 100,
"securityRisk": 10,
"quality": 5,
"test": 5,
"doc": 3,
"ci": 30,
"deploy": 10,
"devEnv": 10,
"outdated": 5
},
"standard": 100,
"ignorePath": [
"node_modules",
"README.md"
],
"debtTags": [
"@debt",
"TODO",
"FIXME"
]
}
您还可以将某些文件标记为“ joconde”一个文件,该文件完美地遵循了代码质量的标准。您可以将以下标签用于相同结果: @best
, @standard
, JOCONDE
。
示例: // JOCONDE React:component "The standard can be find here: http....."
您可以通过在配置文件中使用"ignorePath"
选项来忽略包含某些字符串的文件:
"ignorePath": [
"node_modules",
"README.md"
]
您可以更改用于检测哪个评论行的默认债务标签,应将其视为提利昂的债务评论。 debtTags
.tyrion-config.json
"debtTags": [
"@debt",
"TODO",
"FIXME"
]
此功能不再使用,因为它没有使用。
您可以通过所需的任何类型的债务过滤结果--filter
滤波器。它将比较过滤器后作为参数所传递的类型和字符串。
示例: tyrion -p ./src --filter bug