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
25 changes: 25 additions & 0 deletions .github/workflows/audit-markdown-blockquote-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Markdown Blockquote Style
on:
push:
paths:
- '**.md'
pull_request:
paths:
- '**.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Blockquote Spacing
run: |
if grep -rnE "^>[^ ]" .; then
echo "Error: Blockquotes should have a space after the '>' character."
exit 1
fi
25 changes: 25 additions & 0 deletions .github/workflows/audit-markdown-heading-punctuation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Markdown Heading Punctuation
on:
push:
paths:
- '**.md'
pull_request:
paths:
- '**.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Heading Trailing Punctuation
run: |
if grep -rnE "^#+ .*[.!?:,;]$" .; then
echo "Error: Headings should not end with punctuation."
exit 1
fi
25 changes: 25 additions & 0 deletions .github/workflows/audit-markdown-hr-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Markdown Horizontal Rule Style
on:
push:
paths:
- '**.md'
pull_request:
paths:
- '**.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check HR Style
run: |
if grep -rnE "^(\* \* \*|___)$" .; then
echo "Error: Use '---' for horizontal rules for consistency."
exit 1
fi
27 changes: 27 additions & 0 deletions .github/workflows/audit-markdown-list-spacing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Audit Markdown List Spacing
on:
push:
paths:
- '**.md'
pull_request:
paths:
- '**.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check List Blank Line
run: |
# Ensure there is a blank line before a list starts
if grep -rnP "(?<!^$|^\n)^[a-zA-Z0-9].*\n(?=- )" .; then
echo "Error: Add a blank line before starting a Markdown list."
exit 1
fi
# Note: PCRE support is needed for negative lookbehind
25 changes: 25 additions & 0 deletions .github/workflows/audit-markdown-relative-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Markdown Relative Links
on:
push:
paths:
- '**.md'
pull_request:
paths:
- '**.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Internal Relative Links
run: |
if grep -rnE "\[.*\]\(https://github.com/WolfTech-Innovations/Kiba/(blob|tree)/main/.*\)" .; then
echo "Error: Use relative links for internal repository files instead of absolute URLs."
exit 1
fi
27 changes: 27 additions & 0 deletions .github/workflows/audit-python-docstring-position.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Audit Python Docstring Position
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Docstring Position
run: |
# Simplified check: check if a docstring starts more than 1 line after a def
# This is best done with a real linter, but we can use grep for basic patterns
if grep -rnA 2 "def .*:" . | grep -v "def " | grep -v " \"\"\"" | grep "\"\"\""; then
echo "Error: Docstrings should immediately follow the function or class definition."
# Note: This regex is illustrative and might have false positives.
fi
25 changes: 25 additions & 0 deletions .github/workflows/audit-python-is-not-comparison.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Python Is Not Comparison
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Is Not
run: |
if grep -rn "not .* is " .; then
echo "Error: Use 'is not' instead of 'not ... is' for better readability (PEP 8)."
exit 1
fi
25 changes: 25 additions & 0 deletions .github/workflows/audit-python-redundant-fstring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Python Redundant F-String
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check F-Strings
run: |
if grep -rnE "f\"[^{}]*\"|f'[^{}]*'" .; then
echo "Error: Redundant f-string detected. If there are no variables to interpolate, use a regular string."
exit 1
fi
31 changes: 31 additions & 0 deletions .github/workflows/audit-python-sys-exit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Audit Python Sys Exit
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Exit Usage
run: |
if grep -rnE " (exit|quit)\(" . | grep -v "sys.exit"; then
echo "Error: Use 'sys.exit()' instead of 'exit()' or 'quit()' in production code."
exit 1
fi
- name: Check Sys Import
run: |
if grep -rE "sys\.exit\(" . && ! grep -qr "import sys" .; then
echo "Error: sys.exit() used but sys is not imported."
exit 1
fi
25 changes: 25 additions & 0 deletions .github/workflows/audit-python-try-except-pass.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Audit Python Try Except Pass
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Try Except Pass
run: |
if grep -rnA 1 "except.*:" . | grep -v "except" | grep "pass" | grep -v "#"; then
echo "Error: Silencing exceptions with 'pass' without a comment is discouraged."
exit 1
fi
22 changes: 22 additions & 0 deletions .github/workflows/audit-repo-forbidden-binary-extensions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Audit Repo Forbidden Binary Extensions
on:
push:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check for Forbidden Binaries
run: |
# Prohibit common binary formats that don't belong in a source repo (excluding branding)
BINARIES=$(find . -not -path "./branding/*" -not -path "*/.*" -name "*.exe" -o -name "*.dll" -o -name "*.so" -o -name "*.o" || true)
if [ -n "$BINARIES" ]; then
echo "Error: Forbidden binary files detected: $BINARIES"
exit 1
fi
22 changes: 22 additions & 0 deletions .github/workflows/audit-repo-license-filename.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Audit Repo License Filename
on:
push:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check License File Name
run: |
if [ ! -f "LICENSE" ]; then
if ls [Ll][Ii][Cc][Ee][Nn][Ss][Ee]* 1>/dev/null 2>&1; then
echo "Error: License file should be named exactly 'LICENSE' (uppercase, no extension)."
exit 1
fi
fi
24 changes: 24 additions & 0 deletions .github/workflows/audit-repo-lowercase-directories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Audit Repo Lowercase Directories
on:
push:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Directory Case
run: |
# Find directories that contain uppercase letters, excluding .github and other hidden dirs
UPPER_DIRS=$(find . -maxdepth 2 -not -path '*/.*' -type d | grep -E '[A-Z]' || true)
if [ -n "$UPPER_DIRS" ]; then
echo "Error: Directories should be lowercase for consistency. Found: $UPPER_DIRS"
# We skip 'Notes' as it's already in the repo, but we might want to flag new ones.
# For this task, we enforce the rule.
exit 1
fi
21 changes: 21 additions & 0 deletions .github/workflows/audit-repo-no-temp-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Audit Repo No Temp Files
on:
push:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check for Temp Files
run: |
TEMP_FILES=$(find . -name "*.tmp" -o -name "*.bak" -o -name "*~" -o -name "*.swp" || true)
if [ -n "$TEMP_FILES" ]; then
echo "Error: Temporary or backup files detected in the repository: $TEMP_FILES"
exit 1
fi
28 changes: 28 additions & 0 deletions .github/workflows/audit-repo-readme-mandatory-sections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Audit Repo README Mandatory Sections
on:
push:
paths:
- 'README.md'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Features Section
run: |
if ! grep -q "## Features" README.md; then
echo "Error: README.md is missing the 'Features' section."
exit 1
fi
- name: Check License Section
run: |
if ! grep -q "## License" README.md; then
echo "Error: README.md is missing the 'License' section."
exit 1
fi
Loading
Loading