Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/content-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ jobs:
name: spellcheck-output
path: spellcheck-output.txt
retention-days: 5 # Default is 90 days
- name: Scan for profanities
run: |
pip install better_profanity
python tools/profanity.py
cat profanity_log.txt

- name: Export profanities
uses: actions/upload-artifact@v4
with:
name: profanities
path: profanity_log.txt
retention-days: 5

- name: Scan for malware
run: |
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/external-links.yml

This file was deleted.

108 changes: 0 additions & 108 deletions .github/workflows/maintenance.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/profanity.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/test-lp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test Learning Path
on: pull_request
env:
HUGO_VERSION: 0.130.0

jobs:
Test-Pull-Request:
runs-on: ubuntu-24.04-arm
Expand Down Expand Up @@ -58,6 +58,11 @@ jobs:
- name: Install dependencies
if: steps.changed-markdown-files.outputs.any_changed == 'true'
run: pip install -r tools/requirements.txt
- name: Validate _index.md files
if: steps.changed-markdown-files.outputs.any_changed == 'true'
run: |
echo "Checking YAML fields for changed learning paths..."
python3 tools/verify_index_fields.py ${{ steps.changed-markdown-files.outputs.all_changed_files }}
- name: Run test suite for all changed .md files
id: run-suite
if: steps.changed-markdown-files.outputs.any_changed == 'true'
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package-lock.json
.vscode
.env
startup.sh
data/

# macOS files
*.DS_Store
Expand All @@ -22,4 +23,4 @@ z_local_saved/
*.xml

# CTags symbol index
tags
tags
18 changes: 16 additions & 2 deletions .profanity_ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@ XX
-kill
kill
KVM
#IO_L3N_T0_DQS_AD1N_35
172.X.X.X
kvm
X.X.X
.xx.
.xxx.
naked
facial
Facial
screw
len
LEN
test
TEST
Test
--strip-
(x=x
**VM
Kill
slave
Slave
A55
a55
455
17 changes: 8 additions & 9 deletions tools/profanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def load_excluded_words(file_path):

def scan_for_profanities(directory, log_file, excluded_words_file=None):
exclude_words = None
profanities = None
if excluded_words_file:
exclude_words = load_excluded_words(excluded_words_file)

Expand All @@ -17,23 +18,21 @@ def scan_for_profanities(directory, log_file, excluded_words_file=None):
if file.endswith('.md'): # Read only markdown files
file_path = os.path.join(root, file)
with open(file_path, 'r') as code_file:
profanities = None
content = code_file.read()
if exclude_words:
excluded_content = content
for word in exclude_words:
excluded_content = excluded_content.replace(word, '')
if profanity.contains_profanity(excluded_content):
f.write(f"Profanity found in file: {file_path}\n")
f.write("Profanities found: ")
profanities = set(word for word in excluded_content.split() if profanity.contains_profanity(word))
f.write(", ".join(profanities))
f.write("\n\n")
else:
if profanity.contains_profanity(content):
f.write(f"Profanity found in file: {file_path}\n")
f.write("Profanities found: ")
profanities = set(word for word in content.split() if profanity.contains_profanity(word))
f.write(", ".join(profanities))
f.write("\n\n")
if profanities:
f.write(f"Profanity found in file: {file_path}\n")
f.write("Profanities found: ")
f.write(", ".join(profanities))
f.write("\n\n")

scan_for_profanities("./content/", "./profanity_log.txt", excluded_words_file="./.profanity_ignore.yml")
scan_for_profanities("./content/", "./profanity_log.txt", excluded_words_file="./.profanity_ignore.yml")
Loading