Auto-format code (#277)

This commit is contained in:
Simon Lecoq
2021-04-28 23:05:08 +02:00
committed by GitHub
parent eda35ca6f5
commit 5a33c581fd
10 changed files with 41 additions and 20 deletions

View File

@@ -74,7 +74,7 @@
//Attempt to guess whether tabs or spaces are used in patches
console.debug(`metrics/compute/${login}/plugins > habits > searching indent style`)
patches
.map(({patch}) => patch.match(/((?:\t)|(?:[ ]{2})) /gm) ?? []) //eslint-disable-line prefer-named-capture-group
.map(({patch}) => patch.match(/((?:\t)|(?:[ ]{2})) /gm) ?? [])
.forEach(indent => habits.indents[/^\t/.test(indent) ? "tabs" : "spaces"]++)
habits.indents.style = habits.indents.spaces > habits.indents.tabs ? "spaces" : habits.indents.tabs > habits.indents.spaces ? "tabs" : ""
}