com doc/ru: Добавлен ие проверки правописан ия в CI: .github/workflows/build.yml .github/workflows/spellcheck.yml .yaspellerrc.js

[email protected] (Sergey Panteleev) Mon, 04 Jan 2021 21:28:16 +0000
Newsgroups php.doc.ru
Message-ID <[email protected]>
Commit:    4be155fb279627c76759e9f39b2fb57880df3844
Author:    Alexey Pyltsyn <[email protected]>         Mon, 4 Jan 2021 23:55:33 +0300
Committer: Sergey Panteleev <[email protected]>      Tue, 5 Jan 2021 00:28:16 +0300
Parents:   7b2bc31adf53e925fdf85a547d0d62e439c3ed7c
Branches:  master

Link:       http://git.php.net/?p=doc/ru.git;a=commitdiff;h=4be155fb279627c76759e9f39b2fb57880df3844

Log:
Добавление проверки правописания в CI

Closes GH-7

Changed paths:
  M  .github/workflows/build.yml
  A  .github/workflows/spellcheck.yml
  M  .yaspellerrc.js


Diff:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c72633649..e9caeb09c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,13 +11,6 @@ on:
     - cron: '0 0 * * *'
 
 jobs:
-  # TODO: проверять только измененные в коммите файлы, вынести в отдельный файл
-  # spellcheck:
-  #   runs-on: ubuntu-latest
-  #   steps:
-  #     - uses: actions/checkout@v2
-  #     - run: npx yaspeller --debug
-
   build:
     runs-on: ubuntu-latest
     steps:
@@ -30,4 +23,4 @@ jobs:
         run: |
           git clone --depth=1 https://github.com/php/doc-base.git doc-base
           git clone --depth=1 https://github.com/php/doc-en.git en
-          php doc-base/configure.php --enable-xml-details --disable-libxml-check --redirect-stderr-to-stdout --with-lang=ru
\ No newline at end of file
+          php doc-base/configure.php --enable-xml-details --disable-libxml-check --redirect-stderr-to-stdout --with-lang=ru
diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml
new file mode 100644
index 000000000..2696d1f7c
--- /dev/null
+++ b/.github/workflows/spellcheck.yml
@@ -0,0 +1,22 @@
+name: Spell checking
+
+on:
+  push:
+    branches:
+      - master
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  spellcheck:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Get changed files
+        id: get_file_changes
+        uses: trilom/[email protected]
+        with:
+          output: ' '
+      - name: Run spellchecker
+        run: npx yaspeller ${{ steps.get_file_changes.outputs.files }}
diff --git a/.yaspellerrc.js b/.yaspellerrc.js
index 2ca476fa8..807a7eb44 100644
--- a/.yaspellerrc.js
+++ b/.yaspellerrc.js
@@ -2,6 +2,7 @@ module.exports = {
   excludeFiles: [
     ".git",
     "bookinfo.xml",
+    "**/*.{yml,js}",
   ],
   format: "html",
   lang: "ru",
@@ -253,6 +254,5 @@ module.exports = {
     "эквиваленция",
     "эрмитовая",
     "языкозависим.*",
-    
-  ]
+  ],
 }