소스 검색

Adding Supporting Files For link and Spell Check

Adding files that will be used by the GitHub Action for Spell and Link checks.

Will add the Github workflow once these files get added.
sekyonda 1 년 전
부모
커밋
7af5cc4292
4개의 변경된 파일1132개의 추가작업 그리고 0개의 파일을 삭제
  1. 24 0
      ts_scripts/markdown_link_check_config.json
  2. 20 0
      ts_scripts/spellcheck.sh
  3. 22 0
      ts_scripts/spellcheck_conf/spellcheck.yaml
  4. 1066 0
      ts_scripts/spellcheck_conf/wordlist.txt

+ 24 - 0
ts_scripts/markdown_link_check_config.json

@@ -0,0 +1,24 @@
+{
+  "retryOn429": true,
+  "retryCount": 5,
+  "fallbackRetryDelay": "10s",
+  "httpHeaders": [
+    {
+      "urls": [
+        "https://docs.github.com/",
+        "https://help.github.com/"
+      ],
+      "headers": {
+        "Accept-Encoding": "zstd, br, gzip, deflate"
+      }
+    }
+  ],
+  "ignorePatterns": [
+    {
+      "pattern": "^http(s)?://127.0.0.1.*"
+    },
+    {
+      "pattern": "^http(s)?://localhost.*"
+    }
+  ]
+}

+ 20 - 0
ts_scripts/spellcheck.sh

@@ -0,0 +1,20 @@
+# Source: https://github.com/pytorch/torchx/blob/main/scripts/spellcheck.sh
+set -ex
+sudo apt-get install aspell
+
+if [[ -z "$@" ]]; then
+    sources=$(find -name '*.md')
+else
+    sources=$@
+fi
+
+sources_arg=""
+for src in $sources; do
+        sources_arg="${sources_arg} -S $src"
+done
+
+if [ ! "$sources_arg" ]; then
+	echo "No files to spellcheck"
+else
+	pyspelling -c ts_scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources_arg
+fi

+ 22 - 0
ts_scripts/spellcheck_conf/spellcheck.yaml

@@ -0,0 +1,22 @@
+matrix:
+- name: Markdown
+  apsell:
+    lang: en
+    d: en_US
+  dictionary:
+    wordlists:
+    - ts_scripts/spellcheck_conf/wordlist.txt
+    output: ts_scripts/spellcheck_conf/wordlist.dic
+    encoding: utf-8
+  pipeline:
+  - pyspelling.filters.context:
+      context_visible_first: true
+      delimiters:
+      - open: '(?s)^ *(?P<open>`{3,})[a-z0-9]*?$'
+        close: '^(?P=open)$'
+      - open: ''
+        content: 'https?://[-a-zA-Z0-9.]+?\.[a-z]{2,6}[-?=&%.0-9a-zA-Z/_#]*'
+        close: ''
+  - pyspelling.filters.markdown:
+      markdown_extensions:
+      - markdown.extensions.extra:

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1066 - 0
ts_scripts/spellcheck_conf/wordlist.txt