Skip to content

Commit

Permalink
fix(config): move .env files
Browse files Browse the repository at this point in the history
Move .env files to project root

GH-23
  • Loading branch information
gregswindle committed Apr 23, 2018
1 parent 96546fe commit 2ff8905
Show file tree
Hide file tree
Showing 25 changed files with 1,041 additions and 552 deletions.
14 changes: 12 additions & 2 deletions lib/.env.defaults → .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@

# ENV VARS defaults for readme-inspector:

# ReadmeAppraisal
API_ENDPOINT_README_SCORE="http://readme-score-api.herokuapp.com/score.json?url=&human_breakdown=false&force=false"

# Bitbucket REST API v1.0 and v2.0 base url. Modify this if you're using
# on-premise, company-hosted Bitbucket servers.
BITBUCKET_API_BASE_URL="https://api.bitbucket.org"

## Google Analytics trackingCode
GA_README_INSPECTOR="UA-117338111-1"

# ReadmeAppraisal
API_ENDPOINT_README_SCORE="http://readme-score-api.herokuapp.com/score.json?url=&human_breakdown=false&force=false"
# GitHub REST API v3 baseUrl. Modify this if you're using GitHub Enterprise.
GITHUB_API_BASE_URL="https://api.github.com"

# readme-score-api base url. Modify this if you're using it
# behind a company firewall.
README_SCORE_API_BASE_URL="http://readme-score-api.herokuapp.com"
6 changes: 5 additions & 1 deletion lib/.env.schema → .env.schema
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

# 🔹 OPTIONAL env vars:
API_ENDPOINT_README_SCORE=
BITBUCKET_API_BASE_URL=
GA_README_INSPECTOR=
GITHUB_API_BASE_URL=
README_SCORE_API_BASE_URL=

# 🔸 RECOMMENDED vars (to extend GitHub API rate limits)
# 🔸 RECOMMENDED vars (to extend API rate limits)
BITBUCKET_ACCESS_TOKEN=
GH_TOKEN=
GITHUB_ACCESS_TOKEN=
42 changes: 21 additions & 21 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,10 @@

[![PRs Welcome][makeapullrequest-image]][makeapullrequest-url] We welcome contributors, issues, and pull requests.

<blockquote>
<dfn><strong>Contributions</strong> start with <strong>community conversations</strong> that lead to <strong>positive change.</strong></dfn> <code>readme-inspector's</code> open source collaboration model has five steps:

<dl>
<dt>1. <dfn>Issues</dfn></dt>
<dd>Start community conversations that determine whether proposed changes add value and should be made.</dd>
<dt>2. <dfn>Pull Requests (PRs)</dfn></dt>
<dd>Inform and manage community code reviews for approved changes in-progress.</dd>
<dt>3. <dfn>Merges</dfn></dt>
<dd>Incorporate approved PR changes into the product.</dd>
<dt>4. <dfn>Releases</dfn></dt>
<dd>Make changes available for community consumption.</dd>
<dt>5. <dfn>Support</dfn></dt>
<dd>Improves the product with refactorings and defect fixes.</dd>
</dl>
</blockquote>

## Table of contents

<!-- ⛔️ AUTO-GENERATED-CONTENT:START (TOC:excludeText=Table of contents) -->
- [1. Issues](#1-issues)
- [1. Contributions: a brief "how-to"](#1-contributions-a-brief-how-to)
* [1.1. Create Issues for feature requests and defects.](#11-create-issues-for-feature-requests-and-defects)
* [1.2. Format titles with **`type(scope): subject`**.](#12-format-titles-with-typescope-subject)
* [1.3. Fill out the issue template.](#13-fill-out-the-issue-template)
Expand Down Expand Up @@ -72,7 +55,24 @@
- [9. **Licensing**](#9-licensing)
<!-- ⛔️ AUTO-GENERATED-CONTENT:END -->

## 1. Issues
## 1. Contributions: a brief "how-to"

<blockquote>
<dfn><strong>Contributions</strong> start with <strong>community conversations</strong> that lead to <strong>positive change.</strong></dfn> <code>readme-inspector's</code> open source collaboration model has five steps:

<dl>
<dt>1. <dfn>Issues</dfn></dt>
<dd>Start community conversations that determine whether proposed changes add value and should be made.</dd>
<dt>2. <dfn>Pull Requests (PRs)</dfn></dt>
<dd>Inform and manage community code reviews for approved changes in-progress.</dd>
<dt>3. <dfn>Merges</dfn></dt>
<dd>Incorporate approved PR changes into the product.</dd>
<dt>4. <dfn>Releases</dfn></dt>
<dd>Make changes available for community consumption.</dd>
<dt>5. <dfn>Support</dfn></dt>
<dd>Improves the product with refactorings and defect fixes.</dd>
</dl>
</blockquote>

<img align="bottom" alt="issues" height="80" width="80" src="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/svg/issue-opened.svg">

Expand Down Expand Up @@ -1015,10 +1015,10 @@ Make sure you use resources that you have the rights to use. If you use librarie
[icon-issue-image]: ./assets/img/icons8/icon-issues.png
[icon-pr-image]: ./assets/img/icons8/icon-pr.png
[icon-rest-api-image]: ./assets/img/icons8/icon-rest-api.png
[issues-new-defect-image]: https://img.shields.io/badge/report---defect---lightgrey.svg?style=for-the-badge&label=report+a
[issues-new-defect-image]: https://img.shields.io/badge/report-defect-F5CB5C.svg?style=for-the-badge&label=report+a
[issues-new-defect-url]: /commonality/readme-inspector.git/issues/new?title=defect%28scope%29%3A+summary-of-change&labels=priority%3A+medium%2Cstatus%3A+review+needed%2Ctype%3A+defect&body=%2A%2A%F0%9F%92%A1+TIP%3A%2A%2A+Select+the+%E2%86%96%EF%B8%8E%E2%8E%BE+Preview+%E2%8F%8B+Tab+above+help+read+these+instructions.%0D%0A%0D%0A%23%23+1.+Issue+type%0D%0A%3E%E2%8C%A6+Type+the+letter+%22x%22+in+the+%22checkbox%22+the+best+describe+this+issue.%0D%0A%0D%0A-+%5Bx%5D+**Feature%3A**+I%27m+requesting+a+product+enhancement.%0D%0A%0D%0A%23%23+2.+User+story+summary%0D%0A%3E%E2%8C%A6+Describe+what+you+want+to+accomplish%2C+in+what+role%2Fcapacity%2C+and+why+it%27s+important+to+you.%0D%0A%0D%0A%3E+**EXAMPLE%3A**%0D%0A%3E+As+a+Applicant%2C%0D%0A%3E+I+want+to+submit+my+resume%0D%0A%3E+In+order+to+be+considered+for+a+job+opening.%0D%0A%0D%0AAs+a+%7Brole%7D%2C%0D%0AI+must%2Fneed%2Fwant%2Fshould+%7Bdo+something%7D%0D%0AIn+order+to+%7Bachieve+value%7D.%0D%0A%0D%0A%23%23+3.+Acceptance+criteria%0D%0A%3E%E2%8C%A6+Replace+the+examples+below+with+your+own+imperative%2C+%22true%2Ffalse%22+statements+for+the+**behavior+you+expect**+to+see%2C+or+the+behavior+that+**would**+be+true+if+there+were+no+errors+%28for+defects%29.%0D%0A%0D%0A-+%5B+%5D+1.+Job+Applicants+receive+a+confirmation+email+after+they+submit+their+resumes.%0D%0A-+%5B+%5D+2.+An+Applicant%27s+resume+information+isn%27t+lost+when+errors+occur.%0D%0A-+%5B+%5D+3.+%7Bcriterion-three%7D%0D%0A-+%5B+%5D+4.+%7Bcriterion-four%7D%0D%0A%0D%0A%3C%21--+%E2%9B%94%EF%B8%8F++Do+not+remove+anything+below+this+comment.+%E2%9B%94%EF%B8%8F++--%3E%0D%0A%5Bicon-info-image%5D%3A+..%2Fdocs%2Fimg%2Ficons8%2Ficon-info-50.png%0D%0A
[issues-new-defect-url]: https://github.com/commonality/readme-inspector/issues/new?title=defect%28scope%29%3A+summary-of-problem&labels=priority%3A+medium%2Cstatus%3A+review+needed%2Ctype%3A+defect&body=%2A%2A%F0%9F%92%A1+TIP%3A%2A%2A+Select+the+%E2%86%96%EF%B8%8E%E2%8E%BE+Preview+%E2%8F%8B+Tab+above+help+read+these+instructions.%0D%0A%0D%0A%23%23+1.+Issue+type%0D%0A%3E%E2%8C%A6+Type+the+letter+%22x%22+in+the+%22checkbox%22+the+best+describe+this+issue.%0D%0A%0D%0A-+%5Bx%5D+**Feature%3A**+I%27m+requesting+a+product+enhancement.%0D%0A%0D%0A%23%23+2.+User+story+summary%0D%0A%3E%E2%8C%A6+Describe+what+you+want+to+accomplish%2C+in+what+role%2Fcapacity%2C+and+why+it%27s+important+to+you.%0D%0A%0D%0A%3E+**EXAMPLE%3A**%0D%0A%3E+As+a+Applicant%2C%0D%0A%3E+I+want+to+submit+my+resume%0D%0A%3E+In+order+to+be+considered+for+a+job+opening.%0D%0A%0D%0AAs+a+%7Brole%7D%2C%0D%0AI+must%2Fneed%2Fwant%2Fshould+%7Bdo+something%7D%0D%0AIn+order+to+%7Bachieve+value%7D.%0D%0A%0D%0A%23%23+3.+Acceptance+criteria%0D%0A%3E%E2%8C%A6+Replace+the+examples+below+with+your+own+imperative%2C+%22true%2Ffalse%22+statements+for+the+**behavior+you+expect**+to+see%2C+or+the+behavior+that+**would**+be+true+if+there+were+no+errors+%28for+defects%29.%0D%0A%0D%0A-+%5B+%5D+1.+Job+Applicants+receive+a+confirmation+email+after+they+submit+their+resumes.%0D%0A-+%5B+%5D+2.+An+Applicant%27s+resume+information+isn%27t+lost+when+errors+occur.%0D%0A-+%5B+%5D+3.+%7Bcriterion-three%7D%0D%0A-+%5B+%5D+4.+%7Bcriterion-four%7D%0D%0A%0D%0A%3C%21--+%E2%9B%94%EF%B8%8F++Do+not+remove+anything+below+this+comment.+%E2%9B%94%EF%B8%8F++--%3E%0D%0A%5Bicon-info-image%5D%3A+..%2Fdocs%2Fimg%2Ficons8%2Ficon-info-50.png%0D%0A
[issues-new-feat-image]: https://img.shields.io/badge/request---feature---blue.svg?style=for-the-badge&label=request+a
[issues-new-feat-image]: https://img.shields.io/badge/request-feature-c1ccc6.svg?style=for-the-badge&label=request+a
[issues-new-feat-url]: /commonality/readme-inspector.git/issues/new?title=feat%28scope%29%3A+summary-of-change&labels=priority%3A+medium%2Cstatus%3A+review+needed%2Ctype%3A+feature&body=%2A%2A%F0%9F%92%A1+TIP%3A%2A%2A+Select+the+%E2%86%96%EF%B8%8E%E2%8E%BE+Preview+%E2%8F%8B+Tab+above+help+read+these+instructions.%0D%0A%0D%0A%23%23+1.+Issue+type%0D%0A%3E%E2%8C%A6+Type+the+letter+%22x%22+in+the+%22checkbox%22+the+best+describe+this+issue.%0D%0A%0D%0A-+%5Bx%5D+**Feature%3A**+I%27m+requesting+a+product+enhancement.%0D%0A%0D%0A%23%23+2.+User+story+summary%0D%0A%3E%E2%8C%A6+Describe+what+you+want+to+accomplish%2C+in+what+role%2Fcapacity%2C+and+why+it%27s+important+to+you.%0D%0A%0D%0A%3E+**EXAMPLE%3A**%0D%0A%3E+As+a+Applicant%2C%0D%0A%3E+I+want+to+submit+my+resume%0D%0A%3E+In+order+to+be+considered+for+a+job+opening.%0D%0A%0D%0AAs+a+%7Brole%7D%2C%0D%0AI+must%2Fneed%2Fwant%2Fshould+%7Bdo+something%7D%0D%0AIn+order+to+%7Bachieve+value%7D.%0D%0A%0D%0A%23%23+3.+Acceptance+criteria%0D%0A%3E%E2%8C%A6+Replace+the+examples+below+with+your+own+imperative%2C+%22true%2Ffalse%22+statements+for+the+**behavior+you+expect**+to+see%2C+or+the+behavior+that+**would**+be+true+if+there+were+no+errors+%28for+defects%29.%0D%0A%0D%0A-+%5B+%5D+1.+Job+Applicants+receive+a+confirmation+email+after+they+submit+their+resumes.%0D%0A-+%5B+%5D+2.+An+Applicant%27s+resume+information+isn%27t+lost+when+errors+occur.%0D%0A-+%5B+%5D+3.+%7Bcriterion-three%7D%0D%0A-+%5B+%5D+4.+%7Bcriterion-four%7D%0D%0A%0D%0A%3C%21--+%E2%9B%94%EF%B8%8F++Do+not+remove+anything+below+this+comment.+%E2%9B%94%EF%B8%8F++--%3E%0D%0A%5Bicon-info-image%5D%3A+..%2Fdocs%2Fimg%2Ficons8%2Ficon-info-50.png%0D%0A
[issues-new-feat-url]: https://github.com/commonality/readme-inspector/issues/new?title=feat%28scope%29%3A+summary-of-change&labels=priority%3A+medium%2Cstatus%3A+review+needed%2Ctype%3A+feature&body=%2A%2A%F0%9F%92%A1+TIP%3A%2A%2A+Select+the+%E2%86%96%EF%B8%8E%E2%8E%BE+Preview+%E2%8F%8B+Tab+above+help+read+these+instructions.%0D%0A%0D%0A%23%23+1.+Issue+type%0D%0A%3E%E2%8C%A6+Type+the+letter+%22x%22+in+the+%22checkbox%22+the+best+describe+this+issue.%0D%0A%0D%0A-+%5Bx%5D+**Feature%3A**+I%27m+requesting+a+product+enhancement.%0D%0A%0D%0A%23%23+2.+User+story+summary%0D%0A%3E%E2%8C%A6+Describe+what+you+want+to+accomplish%2C+in+what+role%2Fcapacity%2C+and+why+it%27s+important+to+you.%0D%0A%0D%0A%3E+**EXAMPLE%3A**%0D%0A%3E+As+a+Applicant%2C%0D%0A%3E+I+want+to+submit+my+resume%0D%0A%3E+In+order+to+be+considered+for+a+job+opening.%0D%0A%0D%0AAs+a+%7Brole%7D%2C%0D%0AI+must%2Fneed%2Fwant%2Fshould+%7Bdo+something%7D%0D%0AIn+order+to+%7Bachieve+value%7D.%0D%0A%0D%0A%23%23+3.+Acceptance+criteria%0D%0A%3E%E2%8C%A6+Replace+the+examples+below+with+your+own+imperative%2C+%22true%2Ffalse%22+statements+for+the+**behavior+you+expect**+to+see%2C+or+the+behavior+that+**would**+be+true+if+there+were+no+errors+%28for+defects%29.%0D%0A%0D%0A-+%5B+%5D+1.+Job+Applicants+receive+a+confirmation+email+after+they+submit+their+resumes.%0D%0A-+%5B+%5D+2.+An+Applicant%27s+resume+information+isn%27t+lost+when+errors+occur.%0D%0A-+%5B+%5D+3.+%7Bcriterion-three%7D%0D%0A-+%5B+%5D+4.+%7Bcriterion-four%7D%0D%0A%0D%0A%3C%21--+%E2%9B%94%EF%B8%8F++Do+not+remove+anything+below+this+comment.+%E2%9B%94%EF%B8%8F++--%3E%0D%0A%5Bicon-info-image%5D%3A+..%2Fdocs%2Fimg%2Ficons8%2Ficon-info-50.png%0D%0A
[issues-url]: /commonality/readme-inspector/issues
Expand Down
60 changes: 42 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ GITHUB_ACCESS_TOKEN=
Defines a schema of what variables should be defined in the combination of
<samp>.env</samp> and <samp>.env.defaults</samp>.

<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./lib/.env.schema&syntax=properties) -->
<!-- The below code snippet is automatically added from ./lib/.env.schema -->
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./.env.schema&syntax=properties) -->
<!-- The below code snippet is automatically added from ./.env.schema -->
```properties
# .env.schema, committed to repo

Expand All @@ -111,9 +111,13 @@ Defines a schema of what variables should be defined in the combination of

# 🔹 OPTIONAL env vars:
API_ENDPOINT_README_SCORE=
BITBUCKET_API_BASE_URL=
GA_README_INSPECTOR=
GITHUB_API_BASE_URL=
README_SCORE_API_BASE_URL=

# 🔸 RECOMMENDED vars (to extend GitHub API rate limits)
# 🔸 RECOMMENDED vars (to extend API rate limits)
BITBUCKET_ACCESS_TOKEN=
GH_TOKEN=
GITHUB_ACCESS_TOKEN=
```
Expand All @@ -128,8 +132,8 @@ configuration values that would be common across environments. The
file is loaded and will overwrite any values from the <samp>.env.defaults</samp>
file.

<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./lib/.env.defaults&syntax=properties) -->
<!-- The below code snippet is automatically added from ./lib/.env.defaults -->
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./.env.defaults&syntax=properties) -->
<!-- The below code snippet is automatically added from ./.env.defaults -->
```properties
# .env.defaults, committed to repo

Expand All @@ -143,11 +147,22 @@ file.

# ENV VARS defaults for readme-inspector:

# ReadmeAppraisal
API_ENDPOINT_README_SCORE="http://readme-score-api.herokuapp.com/score.json?url=&human_breakdown=false&force=false"

# Bitbucket REST API v1.0 and v2.0 base url. Modify this if you're using
# on-premise, company-hosted Bitbucket servers.
BITBUCKET_API_BASE_URL="https://api.bitbucket.org"

## Google Analytics trackingCode
GA_README_INSPECTOR="UA-117338111-1"

# ReadmeAppraisal
API_ENDPOINT_README_SCORE="http://readme-score-api.herokuapp.com/score.json?url=&human_breakdown=false&force=false"
# GitHub REST API v3 baseUrl. Modify this if you're using GitHub Enterprise.
GITHUB_API_BASE_URL="https://api.github.com"

# readme-score-api base url. Modify this if you're using it
# behind a company firewall.
README_SCORE_API_BASE_URL="http://readme-score-api.herokuapp.com"
```
<!-- AUTO-GENERATED-CONTENT:END -->

Expand All @@ -158,13 +173,17 @@ This file will have sensitive information such as usernames, passwords,
api keys, etc. These would be specific to each environment and **should
not be committed to source control**.

<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./lib/.env&syntax=properties) -->
<!-- The below code snippet is automatically added from ./lib/.env -->
<!-- AUTO-GENERATED-CONTENT:START (CODE:src=./.env&syntax=properties) -->
<!-- The below code snippet is automatically added from ./.env -->
```properties
API_ENDPOINT_README_SCORE="http://readme-score-api.herokuapp.com/score.json?url=&human_breakdown=false&force=false"
GA_README_INSPECTOR="UA-117338111-1"
GH_TOKEN=$GH_TOKEN
GITHUB_ACCESS_TOKEN=$GH_TOKEN
# BITBUCKET_ACCESS_TOKEN=
# BITBUCKET_API_BASE_URL=
# GA_README_INSPECTOR="UA-117338111-1"
GH_TOKEN=$(echo $GH_TOKEN)
GITHUB_ACCESS_TOKEN=$(echo $GH_TOKEN)
# GITHUB_API_BASE_URL=
# README_SCORE_API_BASE_URL=
```
<!-- AUTO-GENERATED-CONTENT:END -->

Expand Down Expand Up @@ -254,7 +273,7 @@ console.log(JSON.stringify(results, null, WHITESPACE))

> [![beaker][octicon-beaker] Test `readme-inspector` in your Web browser ![link-external][octicon-link-external]][runkit-readme-inspector-url].
>
> [![gear][octicon-gear] View the full API docs for details](docs/readme-inspector/1.0.2/ReadmeAppraisal.html).
> [![gear][octicon-gear] View the full API docs for details ![link-external][octicon-link-external]][api-docs-url].
The `readmeInspector` module detects whether or not a README document exists at the root of a GitHub or GitHub Enterprise repository. If a README exists, it can evaluate the README's quality and provide a numerical score from 0 to 100, where 0 is the lowest quality and 100 is the highest.

Expand All @@ -265,15 +284,19 @@ The `readmeInspector` module detects whether or not a README document exists at
> 1. If you can see the information by visiting the site without being logged in, you don't have to be authenticated to retrieve the same information through the API.
> 1. If you want to change data, you have to be authenticated.
>
> Note: authenticate is synchronous because it only sets the credentials for the following requests.
>
> octokit/rest.js. (2018). GitHub. Retrieved 21 March 2018, from <https://github.com/octokit/rest.js#authentication> ![link-external][octicon-link-external]
#### 3.1.1. Parameters

| Name | Type | Description | Notes |
| :---- | :----- | :--------------------------------------------------------------- | :---- |
| key | String | | |
| token | String | | |
| type | Enum | `basic`, `oauth`, `oauth-key-secret`, `token`, and `integration` | |
| Name | Type | Description |
| :------- | :------------ | :------------------------------------------ |
| key | String | `type=oauth` Client identifier |
| token | String | `type=[integration|token]` Unique value |
| type | Enum.<String> | `basic`, `oauth`, `token`, or `integration` |
| username | String | `type=basic` Basic authentication username |
| password | String | `type=basic` Basic authentication password |

#### 3.1.2. Returns `void`

Expand Down Expand Up @@ -630,6 +653,7 @@ Before embarking on a significant change, please follow these guidelines:
<!-- 🔗 link references 🔗 -->
[api-docs-url]: https://commonality.github.io/readme-inspector/api/readme-inspector/2.0.0/ReadmeAppraisal.html
[bunyan-format-url]: https://github.com/thlorenz/bunyan-format/#readme
[node-bunyan-url]: https://github.com/trentm/node-bunyan/#readme
[optional-param-img]: https://fakeimg.pl/60x22/757575/FFF/?text=optional&font_size=16
Expand Down
Loading

0 comments on commit 2ff8905

Please sign in to comment.