Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: display a meaningful error when the config file is missing #288

Merged
merged 7 commits into from
Oct 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,15 @@
"code",
"test"
]
},
{
"login": "darekkay",
"name": "Darek Kay",
"avatar_url": "https://avatars0.githubusercontent.com/u/3101914?v=4",
"profile": "https://darekkay.com/",
"contributions": [
"code"
]
}
],
"skipCi": true
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ Thanks goes to these wonderful people
<td align="center"><a href="https://www.linkedin.com/in/mloning/"><img src="https://avatars3.githubusercontent.com/u/21020482?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Markus Löning</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=mloning" title="Code">💻</a></td>
<td align="center"><a href="https://dlaa.me/"><img src="https://avatars1.githubusercontent.com/u/1828270?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David Anson</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/issues?q=author%3ADavidAnson" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://favware.tech/"><img src="https://avatars3.githubusercontent.com/u/4019718?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeroen Claassens</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=Favna" title="Code">💻</a></td>
<td align="center"><a href="https://erekspeed.com"><img src="https://avatars3.githubusercontent.com/u/1176550?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Erek Speed</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=melink14" title="Code">💻</a></td>
<td align="center"><a href="http://www.hirez.io"><img src="https://avatars1.githubusercontent.com/u/1430726?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Shai Reznik</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/issues?q=author%3Ashairez" title="Bug reports">🐛</a> <a href="https://github.com/all-contributors/all-contributors-cli/commits?author=shairez" title="Code">💻</a> <a href="https://github.com/all-contributors/all-contributors-cli/commits?author=shairez" title="Tests">⚠️</a></td>
<td align="center"><a href="https://darekkay.com/"><img src="https://avatars0.githubusercontent.com/u/3101914?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Darek Kay</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=darekkay" title="Code">💻</a></td>
<td align="center"><a href="https://erekspeed.com"><img src="https://avatars3.githubusercontent.com/u/1176550?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Erek Speed</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=melink14" title="Code">💻</a></td>
</tr>
</table>

Expand Down
1 change: 1 addition & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function startGeneration(argv) {
}

function addContribution(argv) {
util.configFile.readConfig(argv.config) // ensure the config file exists
const username = argv._[1] === undefined ? undefined : String(argv._[1])
const contributions = argv._[2]
// Add or update contributor in the config file
Expand Down
2 changes: 1 addition & 1 deletion src/generate/__tests__/format-contributor.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ test('format contributor with pipes in their name', () => {
expect(formatContributor(options, contributor)).toBe(expected)
})

test('format contributor with no github account', () => {
test('format contributor with no GitHub account', () => {
const contributor = contributors.nologin
const {options} = fixtures()

Expand Down
4 changes: 2 additions & 2 deletions src/repo/__tests__/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ test('Throw error when missing enterprise authentication', async () => {
)
})

test('handle API rate github errors', async () => {
test('handle API rate GitHub errors', async () => {
const githubErrorMessage =
"API rate limit exceeded for 0.0.0.0. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details."
nock('https://api.github.com').get('/users/nodisplayname').reply(200, {
Expand Down Expand Up @@ -177,7 +177,7 @@ test('append http when no absolute link is provided', async () => {
expect(info.profile).toBe('http://www.github.com/nodisplayname')
})

test('retrieve user from a different github registry', async () => {
test('retrieve user from a different GitHub registry', async () => {
nock('http://github.myhost.com:3000/api/v3')
.get('/users/nodisplayname')
.reply(200, {
Expand Down