From 58ef6507cbcfd0aead21fac093cf764ba56c3b3e Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 12 Jun 2026 14:39:36 +0200 Subject: [PATCH 1/6] Forbidden words checker pipeline --- .github/workflows/forbidden-words.yml | 23 +++++++++++++++ tools/scripts/check-forbidden-words.js | 40 ++++++++++++++++++++++++++ tools/static/forbidden-words.json | 24 ++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 .github/workflows/forbidden-words.yml create mode 100644 tools/scripts/check-forbidden-words.js create mode 100644 tools/static/forbidden-words.json diff --git a/.github/workflows/forbidden-words.yml b/.github/workflows/forbidden-words.yml new file mode 100644 index 0000000..37adc28 --- /dev/null +++ b/.github/workflows/forbidden-words.yml @@ -0,0 +1,23 @@ +name: Forbidden Words Check + +on: + pull_request: + branches: [ main ] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Run forbidden words check + run: node tools/scripts/check-forbidden-words.js diff --git a/tools/scripts/check-forbidden-words.js b/tools/scripts/check-forbidden-words.js new file mode 100644 index 0000000..cd5c989 --- /dev/null +++ b/tools/scripts/check-forbidden-words.js @@ -0,0 +1,40 @@ +import fs from "fs"; +import path from "path"; +import forbiddenWords from "./static/forbidden-words.json"; + + +const forbidden = forbiddenWords.forbiddenWords; +const docsDir = "./docs"; + +let hasErrors = false; + +function scanFile(filePath) { + const content = fs.readFileSync(filePath, "utf8"); + + forbidden.forEach(word => { + if (content.toLowerCase().includes(word)) { + console.log(`❌ Forbidden word "${word}" found in: ${filePath}`); + hasErrors = true; + } + }); +} + +function walk(dir) { + fs.readdirSync(dir).forEach(file => { + const fullPath = path.join(dir, file); + + if (fs.statSync(fullPath).isDirectory()) { + walk(fullPath); + } else if (file.endsWith(".md")) { + scanFile(fullPath); + } + }); +} + +walk(docsDir); + +if (hasErrors) { + process.exit(1); +} else { + console.log("✅ No forbidden words found"); +} diff --git a/tools/static/forbidden-words.json b/tools/static/forbidden-words.json new file mode 100644 index 0000000..7130011 --- /dev/null +++ b/tools/static/forbidden-words.json @@ -0,0 +1,24 @@ +{ + "forbiddenWords": [ + "obviously", + "simply", + "easily", + "just", + "basically", + "clearly", + "literally", + "actually", + "needless to say", + "as you know", + "hack", + "kludge", + "stupid", + "dumb", + "crazy", + "weird", + "awful", + "horrible", + "bad code", + "broken" + ] +} From 29f9d3cc989fb09f3f855526ef629bc0525e71a4 Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 12 Jun 2026 14:43:22 +0200 Subject: [PATCH 2/6] Switched pipeline activation from main to all --- .github/workflows/forbidden-words.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/forbidden-words.yml b/.github/workflows/forbidden-words.yml index 37adc28..e51faef 100644 --- a/.github/workflows/forbidden-words.yml +++ b/.github/workflows/forbidden-words.yml @@ -2,7 +2,7 @@ name: Forbidden Words Check on: pull_request: - branches: [ main ] + branches: [ "*" ] jobs: check: From 27659a52ccd411ab30c49fac62c7fee6eea79523 Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 12 Jun 2026 14:48:58 +0200 Subject: [PATCH 3/6] Changed path to static file --- tools/scripts/check-forbidden-words.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/scripts/check-forbidden-words.js b/tools/scripts/check-forbidden-words.js index cd5c989..28a1e14 100644 --- a/tools/scripts/check-forbidden-words.js +++ b/tools/scripts/check-forbidden-words.js @@ -1,10 +1,10 @@ import fs from "fs"; import path from "path"; -import forbiddenWords from "./static/forbidden-words.json"; +import forbiddenWords from "../static/forbidden-words.json"; const forbidden = forbiddenWords.forbiddenWords; -const docsDir = "./docs"; +const docsDir = "./src/content/docs"; let hasErrors = false; From 67a6a3580460412a4aa9593e64eed1d76ba0e758 Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 12 Jun 2026 14:51:30 +0200 Subject: [PATCH 4/6] Added asser type json --- tools/scripts/check-forbidden-words.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/check-forbidden-words.js b/tools/scripts/check-forbidden-words.js index 28a1e14..7a3bdfc 100644 --- a/tools/scripts/check-forbidden-words.js +++ b/tools/scripts/check-forbidden-words.js @@ -1,6 +1,6 @@ import fs from "fs"; import path from "path"; -import forbiddenWords from "../static/forbidden-words.json"; +import forbiddenWords from "../static/forbidden-words.json" assert { type: "json" }; const forbidden = forbiddenWords.forbiddenWords; From 9c763cdc5da8d2e237a9972cd5f253565b1541fa Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 12 Jun 2026 14:59:48 +0200 Subject: [PATCH 5/6] test commit for pipeline check Error 1: Actually is used in case study Error 2: actually is used in Docs-as-code --- src/content/docs/guides/casestudy.md | 2 +- src/content/docs/guides/example.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/guides/casestudy.md b/src/content/docs/guides/casestudy.md index abd9200..f104924 100644 --- a/src/content/docs/guides/casestudy.md +++ b/src/content/docs/guides/casestudy.md @@ -7,7 +7,7 @@ description: Case study about the Olympic games in Paris 2024 ![A view of Paris and the Olympic logotype for the Olympic Games 2024](../../../assets/olympicsparis.png) -**Paris, France**. After 124 years, Paris hosted the Olympic Games again. At the 1900 games, female athletes were allowed to participate for the first time. This time Paris 2024 aimed to become the most sustainable Olympic Games in modern history. +**Paris, France**. After 124 years, Actually Paris hosted the Olympic Games again. At the 1900 games, female athletes were allowed to participate for the first time. This time Paris 2024 aimed to become the most sustainable Olympic Games in modern history. ## Venues diff --git a/src/content/docs/guides/example.md b/src/content/docs/guides/example.md index 196def4..a4b9391 100644 --- a/src/content/docs/guides/example.md +++ b/src/content/docs/guides/example.md @@ -6,7 +6,7 @@ lang: 'en-uk' # What Is Docs-as-code? -Docs-as-code is a technical writing environment where the technical writer uses the same tools as the software developers. When documenting softwares, this eases the reviewing process and increases the collaboration possibilities. +Docs-as-code is actually a technical writing environment where the technical writer uses the same tools as the software developers. When documenting softwares, this eases the reviewing process and increases the collaboration possibilities. ## Benefits From 91adc72f7f919ad588e54c07d1c20f76d8055940 Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 12 Jun 2026 15:02:22 +0200 Subject: [PATCH 6/6] Test succesful Removing actuallies --- src/content/docs/guides/casestudy.md | 2 +- src/content/docs/guides/example.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/guides/casestudy.md b/src/content/docs/guides/casestudy.md index f104924..abd9200 100644 --- a/src/content/docs/guides/casestudy.md +++ b/src/content/docs/guides/casestudy.md @@ -7,7 +7,7 @@ description: Case study about the Olympic games in Paris 2024 ![A view of Paris and the Olympic logotype for the Olympic Games 2024](../../../assets/olympicsparis.png) -**Paris, France**. After 124 years, Actually Paris hosted the Olympic Games again. At the 1900 games, female athletes were allowed to participate for the first time. This time Paris 2024 aimed to become the most sustainable Olympic Games in modern history. +**Paris, France**. After 124 years, Paris hosted the Olympic Games again. At the 1900 games, female athletes were allowed to participate for the first time. This time Paris 2024 aimed to become the most sustainable Olympic Games in modern history. ## Venues diff --git a/src/content/docs/guides/example.md b/src/content/docs/guides/example.md index a4b9391..196def4 100644 --- a/src/content/docs/guides/example.md +++ b/src/content/docs/guides/example.md @@ -6,7 +6,7 @@ lang: 'en-uk' # What Is Docs-as-code? -Docs-as-code is actually a technical writing environment where the technical writer uses the same tools as the software developers. When documenting softwares, this eases the reviewing process and increases the collaboration possibilities. +Docs-as-code is a technical writing environment where the technical writer uses the same tools as the software developers. When documenting softwares, this eases the reviewing process and increases the collaboration possibilities. ## Benefits