Use package.json for installing spell/link checking (#516)

This a better practice for installing npm dependencies which are local to a particular project.
This commit is contained in:
William Lachance 2020-07-09 09:26:57 -04:00 коммит произвёл GitHub
Родитель 5443abd83d
Коммит 5efb3b742b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 1074 добавлений и 14 удалений

Просмотреть файл

@ -190,6 +190,7 @@ nbconvert
nbviewer
nginx
ni
node.js
non-e10s
NoSQL
nullable

Просмотреть файл

@ -14,15 +14,15 @@ matrix:
node_js:
- 12
script:
- npm install markdown-spellcheck -g
- bash scripts/spell_check.sh
- npm install
- scripts/spell_check.sh
- name: link-check
language: node_js
node_js:
- 12
script:
- npm install markdown-link-check -g
- bash scripts/link_check.sh
- npm install
- scripts/link_check.sh
allow_failures:
- name: link-check
deploy:

Просмотреть файл

@ -48,6 +48,8 @@ mdbook-dtmo serve
The complete documentation for the mdBook toolchain is available online at <https://rust-lang.github.io/mdBook/>.
If you run into any problems, please [let us know](https://docs.telemetry.mozilla.org/concepts/getting_help.html). We are happy to change the tooling to make it as much fun as possible to write.
This documentation has some automatic checks for spelling and link validity in continuous integration. See the respective sections in the [contributing article](https://docs.telemetry.mozilla.org/meta/contributing.html) for more information.
## Contributing
See [this article](https://docs.telemetry.mozilla.org/meta/contributing.html) for detailed information on how to make additions or changes to the documentation.
See [contributing](https://docs.telemetry.mozilla.org/meta/contributing.html) for detailed information on how to make additions or changes to the documentation.

1039
package-lock.json сгенерированный Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

19
package.json Normal file
Просмотреть файл

@ -0,0 +1,19 @@
{
"name": "firefox-data-docs",
"version": "1.0.0",
"description": "Documentation about Mozilla's Data Platform",
"repository": {
"type": "git",
"url": "git+https://github.com/mozilla/firefox-data-docs.git"
},
"author": "",
"license": "MPL",
"bugs": {
"url": "https://bugzilla.mozilla.org/buglist.cgi?product=Data Platform and Tools&component=Documentation and Knowledge Repo (RTMO)"
},
"homepage": "https://docs.telemetry.mozilla.org",
"dependencies": {
"markdown-link-check": "^3.8.1",
"markdown-spellcheck": "^1.3.1"
}
}

Просмотреть файл

@ -8,4 +8,4 @@ fi
find src -name "*.md" |\
sort |\
$RUNNER -P 8 markdown-link-check --quiet --verbose --config .linkcheck.json
$RUNNER -P 8 npx markdown-link-check --quiet --verbose --config .linkcheck.json

Просмотреть файл

@ -1,7 +1,7 @@
#!/bin/sh
#!/bin/bash
# file ignores are broken in .spelling, list them in this script instead
mdspell \
npx mdspell \
'src/**/*.md' \
'!src/cookbooks/new_ping_metadata_table.md' \
--ignore-numbers \

Просмотреть файл

@ -65,9 +65,7 @@ the `.spelling` file in the code repository.
For things like dataset names or field names, `code blocks` should be preferred. Things like
project names or common technical terms should be added to the `.spelling` file.
To run the spell checker locally,
[install the `markdown-spellcheck` library](https://www.npmjs.com/package/markdown-spellcheck),
then run the `scripts/spell_check.sh` script from the root of the repository.
The [markdown-spell-check](https://www.npmjs.com/package/markdown-spellcheck) package checks spelling as part of the build process. To run it locally, install [node.js](https://nodejs.org/en/) (if not already installed) and run `npm install` at the root of the repository. Then run the `scripts/link_check.sh` script.
You may also remove the `--report` parameter to begin an interactive fixing session. In this
case, it is highly recommended to also add the `--no-suggestions` parameter, which greatly
@ -75,10 +73,11 @@ speeds things up.
## Link checking
Any web links should be valid. A dead link might not be your fault, but you will earn a lot
of good karma by fixing a dead link!
Any web links should be valid. A dead link might not be your fault, but you will earn a lot of good karma by fixing a dead link!
To run the link checker locally, [install the `markdown-link-check` library](https://github.com/tcort/markdown-link-check#installation), then run the `scripts/link_check.sh` script from the root of the repository.
The [markdown-link-check](https://www.npmjs.com/package/markdown-link-check) package checks links as part of the build process. Note that dead links do not fail the build: links often go dead for all sorts of reasons, and making it a required check constantly caused otherwise-fine pull requests to appear broken. Still, you should check the status of this check yourself when submitting a pull request: you can do this by looking at the Travis CI status after submitting it.
To run link checking locally, run the installation steps [described for spell checking](#spell-checking) if you haven't already, then run the `scripts/link_check.sh` script.
## Supported Plugins