Skip to content

Commit 7a71637

Browse files
authored
fix(config): add default .env var values
* fix(envvars): add default .env var values * Add api-client-options objects * Fix broken PULL_REQUEST_TEMPLATE.md image references * Refactor octicon link refs (make them shorter) * Replace module dotenv with dotenv-extended to enable defaults * Specify MIT license in /lib/index.js Resolves GH-11 and GH-10
1 parent e3583e0 commit 7a71637

18 files changed

+571
-527
lines changed

.github/CONTRIBUTING.md

Lines changed: 175 additions & 172 deletions
Large diffs are not rendered by default.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ $ npm test
101101

102102
<!-- ⛔️ Logo img references ⛔️ -->
103103

104-
[logo-eslint]: ./assets/img/logo-eslint.png
105-
[logo-jest]: ./assets/img/logo-jest.png
104+
[logo-eslint]: https://raw.githubusercontent.com/commonality/readme-inspector/master/.github/assets/img/logo-eslint.png
105+
[logo-jest]: https://raw.githubusercontent.com/commonality/readme-inspector/master/.github/assets/img/logo-jest.png
106106

107107
<!-- ⛔️ Octicon img references ⛔️ -->
108108

.travis.yml

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,50 @@
1-
---
21
addons:
32
sonarcloud:
4-
organization: "$SONAR_ORGANIZATION"
3+
organization: "$SONAR_ORGANIZATION"
54
token:
6-
secure: "$SONAR_TOKEN"
5+
secure: "$SONAR_TOKEN"
76
github_token:
8-
secure: "$GITHUB_ACCESS_TOKEN"
7+
secure: "$GITHUB_ACCESS_TOKEN"
98
branches:
10-
- master
11-
- /[build|chore|ci|docs|feat|fix|perf|refactor|revert|spike|style|test]\/.*/
12-
9+
- master
10+
- "/[build|chore|ci|docs|feat|fix|perf|refactor|revert|spike|style|test]\\/.*/"
1311
jdk:
14-
- oraclejdk8
15-
12+
- oraclejdk8
1613
language: node_js
17-
1814
node_js:
19-
- 9
20-
- 8
21-
- 7
22-
15+
- 9
16+
- 8
17+
- 7
2318
os:
24-
- linux
25-
- osx
26-
19+
- linux
20+
- osx
2721
notifications:
2822
webhooks: https://app.fossa.io/hooks/travisci
29-
3023
git:
3124
depth: 1
32-
25+
before_install:
26+
- "[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest"
27+
- npm install -g greenkeeper-lockfile@1
3328
before_script:
34-
- npm dedupe
35-
29+
- greenkeeper-lockfile-update
30+
- npm dedupe
3631
script:
37-
- npm run test:config
38-
- npm test
39-
32+
- npm run test:config
33+
- npm test
4034
after_script:
41-
- npm run posttest:ci:coverage:codacy
42-
- sonar-scanner -Dproject.settings=./.github/config/sonar-project.properties -Dsonar.organization=$SONAR_ORGANIZATION -Dsonar.login=$SONAR_COMMONALITY_TOKEN -X
43-
35+
- greenkeeper-lockfile-upload
36+
- npm run posttest:ci:coverage:codacy
37+
- sonar-scanner -Dproject.settings=./.github/config/sonar-project.properties -Dsonar.organization=$SONAR_ORGANIZATION
38+
-Dsonar.login=$SONAR_COMMONALITY_TOKEN -X
4439
jobs:
4540
include:
46-
# Define the release stage that runs semantic-release
47-
- stage: release
48-
node_js: lts/*
49-
deploy:
50-
provider: script
51-
skip_cleanup: true
52-
script:
53-
# - npm run docs:changelog
54-
- npx travis-deploy-once "npx semantic-release"
41+
- stage: release
42+
node_js: lts/*
43+
deploy:
44+
provider: script
45+
skip_cleanup: true
46+
script:
47+
- npx travis-deploy-once "npx semantic-release"
48+
env:
49+
global:
50+
secure: VFXeKWEb3ji3GXHQ4u0GLmyqnuVDHfe3dvP/6AD00Dzf25iox4kC4Ru2an7UPca7q19rB35RVXY3mYCIvC6IYRZO611HwI8/zZlUQVmz4KOGYCGXZpc9ylHzQUwwPq+5DyMHWKwDLsWvlm4IziPYURPIrc33CagrqMuAijyf0SVdZVRVZXQXlQ39YNxhnjqGP6ezOhvjlV22Be97HNo3R+18wnMTIdStOfayKHRTF7akEMWrrugZTUga3aJDflTBREfGrkkiyfOEfu8rR1wuWbgSVLC38c3y/3di5jmj6qH8c/Tqgt2FJEDEC+iXeIOb9a4imgsNdhz4raYe/sdcCvC/cqdR6Q8dKWTEm3p0waam4pA8tReFg8JHF0Jfu3rXi+JroF6ZbIB4223Ez73L715rrGwnNvepWoXqkT4NqAvPTxgmowr2I4BZnCjauO1u9yLuZaP6xkFFDiZh9GsuCtQRSeDgrNxRMiKCCsyEgoVNoFIILvAFiC2cJdS8/tRZGV6hSaFef4WmOEtBxJh0O8vYiZH/X8B/MX0IME6pN703k9z5WpTFZvUEhqYHPfE8+TiL6dm1jwgg1RIreu8V3fqb5o37C5XQLDXERmGY2y/u6wR8KkBs4XIMQ9RwuF2+KeVoQBJgqDmNnohVNrOXMpZfmMaPxl3TgrqYFpxYrzY=

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file. See [standa
1010

1111
* **module:readme-inspector:** Verify the existence—and assess the quality—of README files
1212

13-
> ![quote][icon-octicon-quote] READMEs do more than explain how to use your project. They also
13+
> ![quote][octicon-quote] READMEs do more than explain how to use your project. They also
1414
> explain why your project matters, and what your users can do with it.
1515
>
1616
> In your README, try to answer the following questions:
@@ -52,4 +52,4 @@ All notable changes to this project will be documented in this file. See [standa
5252

5353
([e04a07a](https://github.com/commonality/readme-inspector/commit/e04a07a)), closes [#1](https://github.com/commonality/readme-inspector/issues/1)
5454

55-
[icon-octicon-quote]: https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/svg/quote.svg
55+
[octicon-quote]: https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/svg/quote.svg

README.md

Lines changed: 199 additions & 210 deletions
Large diffs are not rendered by default.

lib/.env.defaults

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# .env.defaults, committed to repo
2+
3+
## See https://github.com/keithmorris/node-dotenv-extended/#readme
4+
## ⛔️
5+
## 🚫 DO NOT COMMIT YOUR ACTUAL .env file to version control.
6+
## 🚫 It should only include environment-specific values such
7+
## 🚫 as database passwords or API keys.
8+
## 🚫 Your production database should have a different password
9+
## 🚫 than your development database.
10+
11+
# ENV VARS defaults for readme-inspector:
12+
13+
## Google Analytics trackingCode
14+
GA_README_INSPECTOR="UA-117338111-1"
15+
16+
# ReadmeScore
17+
API_ENDPOINT_README_SCORE="http://readme-score-api.herokuapp.com/score.json?url=&human_breakdown=false&force=false"

lib/.env.example

Lines changed: 0 additions & 33 deletions
This file was deleted.

lib/.env.schema

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# .env.schema, committed to repo
2+
3+
## See https://github.com/keithmorris/node-dotenv-extended/#readme
4+
## ⛔️
5+
## 🚫 DO NOT COMMIT YOUR ACTUAL .env file to version control.
6+
## 🚫 It should only include environment-specific values such
7+
## 🚫 as database passwords or API keys.
8+
## 🚫 Your production database should have a different password
9+
## 🚫 than your development database.
10+
11+
# ENV VARS required for readme-inspector
12+
## Add values to these ENV VARs and save to
13+
## {your-project-root-directory}/.env
14+
15+
# ▫️ OPTIONAL env vars:
16+
API_ENDPOINT_README_SCORE=
17+
CODACY_PROJECT_TOKEN=
18+
GA_README_INSPECTOR=
19+
20+
# 🔸 RECOMMENDED vars (to extend GitHub API rate limits)
21+
GH_TOKEN=
22+
GITHUB_ACCESS_TOKEN=
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const dotenvExtended = jest.genMockFromModule('dotenv-extended')
2+
3+
const envConfig = {
4+
'API_ENDPOINT_README_SCORE':
5+
'http://readme-score-api.herokuapp.com/score.json?url=',
6+
'CODACY_PROJECT_TOKEN': 'MOCK_CODACY_PROJECT_TOKEN',
7+
'GA_README_INSPECTOR': 'UA-111111111-1',
8+
'GH_TOKEN': 'MOCK_GITHUB_ACCESS_TOKEN'
9+
}
10+
11+
dotenvExtended.config = jest.fn().mockReturnValue(envConfig)
12+
13+
module.exports = dotenvExtended

lib/__tests__/__mocks__/dotenv.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)