From a8c473c333ff54e0998f9d8028a0d3d58d3d6661 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 14 May 2024 11:57:22 -0400 Subject: [PATCH] Basic tooling: link & spell chack, and formatting Signed-off-by: Patrice Chalin --- .cspell.yml | 24 ++++++++++++++++++++++++ .gitignore | 3 +++ .markdown-link-check.json | 10 ++++++++++ .prettierignore | 6 ++++++ .vscode/cspell.json | 9 --------- package.json | 29 +++++++++++++++++++++++++++++ 6 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 .cspell.yml create mode 100644 .gitignore create mode 100644 .markdown-link-check.json create mode 100644 .prettierignore delete mode 100644 .vscode/cspell.json create mode 100644 package.json diff --git a/.cspell.yml b/.cspell.yml new file mode 100644 index 0000000..155326b --- /dev/null +++ b/.cspell.yml @@ -0,0 +1,24 @@ +# cSpell:ignore textlintrc +# For settings, see +# https://www.streetsidesoftware.com/vscode-spell-checker/docs/configuration/ +version: '0.2' +caseSensitive: true +# ignorePaths: +# - '*.svg' +# patterns: +# - name: CodeBlock +# pattern: | +# / +# ^(\s*[~`]{3,}) # code-block start +# .* # all languages and options, e.g. shell {hl_lines=[12]} +# [\s\S]*? # content +# \1 # code-block end +# /igmx # cspell:disable-line +# languageSettings: +# - languageId: markdown +# ignoreRegExpList: +# - CodeBlock +words: + - CNCF + - Docsy + - techdocs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7807fd3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# npm assets +node_modules/ +package-lock.json diff --git a/.markdown-link-check.json b/.markdown-link-check.json new file mode 100644 index 0000000..0d31049 --- /dev/null +++ b/.markdown-link-check.json @@ -0,0 +1,10 @@ +{ + "ignorePatterns": [ + { + "pattern": "^http://localhost" + } + ], + "timeout": "3s", + "retryOn429": true, + "aliveStatusCodes": [200, 206] +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..82741e1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +.github + +# temporary + +assessments +docs diff --git a/.vscode/cspell.json b/.vscode/cspell.json deleted file mode 100644 index df86f16..0000000 --- a/.vscode/cspell.json +++ /dev/null @@ -1,9 +0,0 @@ -// For settings, see https://www.streetsidesoftware.com/vscode-spell-checker/docs/configuration/ -{ - "version": "0.2", - "caseSensitive": true, - "words": [ - "CNCF", - "Docsy" - ] -} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5d8e718 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "techdocs", + "version": "0.0.0", + "description": "Resources provided by the CNCF Technical Documentation team.", + "scripts": { + "_check:format:any": "npx prettier --check --ignore-path ''", + "_check:format": "npx prettier --check .", + "check:format": "npm run _check:format || (echo '[help] Run: npm run fix:format'; exit 1)", + "check:links": "npx markdown-link-check --config .markdown-link-check.json *.md", + "check:spelling": "npx cspell --no-progress -c .cspell.yml .", + "check": "npm run seq -- $(npm run -s _list:check:*)", + "fix:format": "npm run _check:format -- --write", + "fix": "npm run seq -- $(npm -s run _list:fix:*)", + "seq": "bash -c 'for cmd in \"$@\"; do npm run $cmd || exit 1; done' - ", + "test": "npm run check" + }, + "author": "CNCF", + "license": "CC-BY-4.0", + "devDependencies": { + "cspell": "^8.8.1", + "markdown-link-check": "^3.12.1", + "prettier": "^3.2.5" + }, + "private": true, + "prettier": { + "proseWrap": "always", + "singleQuote": true + } +}