The Compare command

Compare 2 git revisions against each other and see the evolution of your debt between them

debt-collector compare --revision {GIT_REV}

where GIT_REV is a hash, commit, or a branch where Git is able to checkout onto

circle-info

This command is useful (and has been thought to do so) to publish Pull request reports. It's mostly designed to run in a CI environment, but you can run it from anywhere

triangle-exclamation

Example :

debt-collector compare --revision main

In this case, debt-collector will compare the "Main" branch with the current head.

circle-exclamation

The compare command will first check the Main branch, then analyse Diff between the ancestor and current head. And then report for every modified files, the debt score evolution, and provide hints on how to reduce the debt further.

Optional flags :

flag
argument
description

--revision

string: a git revision

the revision (hash or branch) to compare with the current HEAD

--rule / -r

string: a rule Id

display results for one specific rule

--tags / -t

array: a list of tags

filter results by rule tags

--include / -g

string: a glob pattern

override the include configuration

--html-report

boolean (default: false)

generate an HTML report

--common-ancestor

boolean (default: true)

use the merge-base (common ancestor) for the diff

--config / -c

string: path to the config file

change the default config path

--help

display help

Last updated