fix(plugin/languages): skip merge commits from recent analysis (#517)

This commit is contained in:
Simon Lecoq
2021-09-04 09:46:01 +02:00
committed by GitHub
parent 649feab3df
commit a6ad9da789

View File

@@ -75,9 +75,11 @@ export async function recent({login, data, imports, rest, account}, {skipped = [
.flatMap(({payload}) => payload.commits) .flatMap(({payload}) => payload.commits)
.filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length) .filter(({author}) => data.shared["commits.authoring"].filter(authoring => author?.email?.toLocaleLowerCase().includes(authoring)||author?.name?.toLocaleLowerCase().includes(authoring)).length)
.map(commit => commit.url) .map(commit => commit.url)
.map(async commit => (await rest.request(commit)).data.files), .map(async commit => (await rest.request(commit)).data),
), )
] ]
.filter(({parents}) => parents.length <= 1)
.map(({files}) => files)
.filter(({status}) => status === "fulfilled") .filter(({status}) => status === "fulfilled")
.map(({value}) => value) .map(({value}) => value)
.flatMap(files => files.map(file => ({name:imports.paths.basename(file.filename), directory:imports.paths.dirname(file.filename), patch:file.patch ?? "", repo:file.raw_url?.match(/(?<=^https:..github.com\/)(?<repo>.*)(?=\/raw)/)?.groups.repo ?? "_"}))) .flatMap(files => files.map(file => ({name:imports.paths.basename(file.filename), directory:imports.paths.dirname(file.filename), patch:file.patch ?? "", repo:file.raw_url?.match(/(?<=^https:..github.com\/)(?<repo>.*)(?=\/raw)/)?.groups.repo ?? "_"})))