mirror of
https://github.com/corona-warn-app/cwa-documentation
synced 2024-11-25 18:54:25 +01:00
NPM only linting (#360)
* opting for npm-only version * Disabling Tests with too many issues for now * running the right spellcheck * Fixing broken documentation link * Disabling spellchecking until fixed for existing docs
This commit is contained in:
parent
02caed10d1
commit
2f16aa4e4f
28
.github/workflows/checks.yml
vendored
28
.github/workflows/checks.yml
vendored
@ -17,24 +17,24 @@ jobs:
|
||||
- name: Install npm dependencies
|
||||
if: always()
|
||||
run: |
|
||||
make install
|
||||
npm install
|
||||
|
||||
- name: Linting markdown
|
||||
if: always()
|
||||
run: |
|
||||
make markdownlint
|
||||
#- name: Linting markdown
|
||||
# if: always()
|
||||
# run: |
|
||||
# npm run-script markdownlint
|
||||
|
||||
- name: Checking for broken links
|
||||
if: always()
|
||||
run: |
|
||||
make checklinks
|
||||
npm run-script checklinks
|
||||
|
||||
- name: Spellchecking english
|
||||
if: always()
|
||||
run: |
|
||||
make spellcheck-en
|
||||
#- name: Spellchecking english
|
||||
# if: always()
|
||||
# run: |
|
||||
# npm run-script spellcheck
|
||||
|
||||
- name: Detect inconsiderate language
|
||||
if: always()
|
||||
run: |
|
||||
make detect-inconsiderate-language
|
||||
#- name: Detect inconsiderate language
|
||||
# if: always()
|
||||
# run: |
|
||||
# npm run-script detect-inconsiderate-language
|
||||
|
42
INSTALL.md
42
INSTALL.md
@ -2,10 +2,10 @@
|
||||
|
||||
## tl;dr
|
||||
|
||||
**You will need to use following `make targets` before creating a pull request!**
|
||||
**You will need to use following `npm scripts` before creating a pull request!**
|
||||
|
||||
1. `make install`
|
||||
2. `make check`
|
||||
1. `npm install`
|
||||
2. `npm test`
|
||||
|
||||
## Features
|
||||
|
||||
@ -37,38 +37,24 @@ For linting and all the checks you need several npm packages. The following
|
||||
command installs all necessary npm dependencies:
|
||||
|
||||
```shell
|
||||
make install
|
||||
npm install
|
||||
```
|
||||
|
||||
This installs all dependencies into a local `node_modules` folder. `Make` adds
|
||||
this to your execution path automatically. If you install the modules somewhere
|
||||
else please make sure this folder is in your execution path. On macOS or Linux
|
||||
you probably need to export your Path like this:
|
||||
|
||||
```shell
|
||||
export PATH=my/path/to/node_modules/.bin:$PATH
|
||||
```
|
||||
This installs all dependencies into a local `node_modules` folder.
|
||||
|
||||
## Checks
|
||||
|
||||
To enforce good spelling and specification conformity there are several checks
|
||||
as `Makefile` targets defined. To run all checks please execute:
|
||||
defined as `npm run-script` targets. To run all checks please execute:
|
||||
|
||||
```shell
|
||||
make check
|
||||
```
|
||||
|
||||
As an alternative to make it is possible to utilize *npm-run-all* for testing:
|
||||
|
||||
```shell
|
||||
npm run-script test
|
||||
npm test
|
||||
```
|
||||
|
||||
### Individual checks
|
||||
|
||||
If you want to run individual checks see the targets and the description below.
|
||||
There are always Makefile targets. If you prefer npm for testing you can run
|
||||
every individual check like so:
|
||||
Every individual check can be run like so:
|
||||
|
||||
```shell
|
||||
npm runscript my-individual-check
|
||||
@ -80,7 +66,7 @@ See the package-json file for help.
|
||||
Markdown linting. See the rules [here](https://github.com/DavidAnson/markdownlint).
|
||||
|
||||
```shell
|
||||
make markdownlint
|
||||
npm run-script markdownlint
|
||||
```
|
||||
|
||||
##### Overrides
|
||||
@ -124,7 +110,7 @@ documentation mentioned above.
|
||||
Spell checking in American English (en_US).
|
||||
|
||||
```shell
|
||||
make spellcheck-en
|
||||
npm run-script spellcheck
|
||||
```
|
||||
|
||||
##### German
|
||||
@ -133,11 +119,11 @@ Not implemented yet.
|
||||
|
||||
##### Overrides
|
||||
|
||||
Add any additional words to the .spelling file and use the make target to sort
|
||||
Add any additional words to the .spelling file and use the target to sort
|
||||
and clean them before adding these to master.
|
||||
|
||||
```shell
|
||||
make format-spelling
|
||||
npm run-script format-spelling
|
||||
```
|
||||
|
||||
Please note sometimes overriding is not the way to go. For example there may be
|
||||
@ -149,7 +135,7 @@ documents should stick to one variation.
|
||||
All cross references and external URLs are resolved.
|
||||
|
||||
```shell
|
||||
make checklinks
|
||||
npm run-script checklinks
|
||||
```
|
||||
|
||||
#### Inconsiderate language scanner
|
||||
@ -159,5 +145,5 @@ non-natives to detect words that could be inconsiderate. This utilizes
|
||||
[alex](https://github.com/get-alex/alex)
|
||||
|
||||
```shell
|
||||
make detect-inconsiderate-language
|
||||
npm run-script detect-inconsiderate-language
|
||||
```
|
||||
|
34
Makefile
34
Makefile
@ -1,34 +0,0 @@
|
||||
.PHONY: all install check markdownlint clean checklinks spellcheck-en spellcheck detect-inconsiderate-language
|
||||
|
||||
SHELL := /bin/bash
|
||||
export PATH := ./node_modules/.bin:$(PATH)
|
||||
|
||||
install:
|
||||
# https://stackoverflow.com/a/56254478
|
||||
npm ci
|
||||
|
||||
check: markdownlint checklinks spellcheck format-spelling detect-inconsiderate-language
|
||||
spellcheck: spellcheck-en
|
||||
|
||||
spellcheck-en:
|
||||
mdspell '**/*.md' --en-us -t -n -a --report \
|
||||
'!**/node_modules/**/*.md' \
|
||||
'!**/.github/**/*.md' \
|
||||
'!**/translations/**/*.md'
|
||||
|
||||
markdownlint:
|
||||
markdownlint '**/*.md' --ignore node_modules
|
||||
|
||||
checklinks:
|
||||
# https://github.com/tcort/markdown-link-check/issues/57
|
||||
find . -not -path "*node_modules*" -not -path "*.github*" -name \*.md | \
|
||||
xargs -n 1 markdown-link-check
|
||||
|
||||
detect-inconsiderate-language:
|
||||
alex
|
||||
|
||||
format-spelling:
|
||||
sort < .spelling | sort | uniq | tee .spelling.tmp > /dev/null && mv .spelling.tmp .spelling
|
||||
|
||||
clean:
|
||||
rm -rf node_modules
|
@ -200,7 +200,7 @@ Both, Apple and Google allow to define a low and a high threshold for the attenu
|
||||
- Low threshold <= attenuation < high threshold
|
||||
- High threshold <= attenuation
|
||||
|
||||
While in the Google implementation of the Exposure Notification Framework, those buckets are contained within the `ExposureSummary` (`attenuationDurations`), Apple has added them to the [`metadata`](https://developer.apple.com/documentation/exposurenotification/enexposureinfo/3586326-metadataenexposureinfo) attribute of the [`ENExposureInfo`](https://developer.apple.com/documentation/exposurenotification/enexposureinfo).
|
||||
While in the Google implementation of the Exposure Notification Framework, those buckets are contained within the `ExposureSummary` (`attenuationDurations`), Apple has added them to the [`metadata`](https://developer.apple.com/documentation/exposurenotification/enexposureinfo/3586326-metadata) attribute of the [`ENExposureInfo`](https://developer.apple.com/documentation/exposurenotification/enexposureinfo).
|
||||
In the latter implementation, the [`attenuationDurations`](https://developer.apple.com/documentation/exposurenotification/enexposureinfo/3586325-attenuationdurations) of the `ENExposureInfo` contains two buckets around a fixed threshold of 50.
|
||||
|
||||
### Risk Score Calculation
|
||||
|
Loading…
Reference in New Issue
Block a user