forked from todogroup/repolinter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: merge contributor-count axiom into fork
- Loading branch information
1 parent
002deae
commit f3dc857
Showing
12 changed files
with
708 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
module.exports = [ | ||
'licensee', | ||
'linguist', | ||
'packagers' | ||
'packagers', | ||
'contributor-count' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2017 TODO Group. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
const { gitlogPromise } = require('gitlog') | ||
const Result = require('../lib/result') | ||
|
||
module.exports = async function (fileSystem) { | ||
const commits = await gitlogPromise({ | ||
repo: fileSystem.targetDir, | ||
all: true, | ||
number: 10000 // Fetch the last 10000 commits | ||
}) | ||
if (!commits) { | ||
return new Result('GitLog axiom failed to run, is this project a git repository?', [], false) | ||
} | ||
// Get commit authors and filter unique values | ||
const contributors = commits | ||
.map((commit) => commit.authorName.toLowerCase()) | ||
.filter((value, index, self) => self.indexOf(value) === index) | ||
return new Result('', [{ path: contributors.length.toString(), passed: true }], true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.