Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix: modify format.yml to skip README-only changes

KaifAhmad1df4b9d1b8eab
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 9dd3ce10..f61bf0c3 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -1,49 +1,64 @@
-name: Format Code
-
-# Ensures code follows consistent formatting style on every push and pull request
-# Prevents unformatted code from being merged and keeps the codebase tidy automatically
+name: Format Check
on:
- pull_request:
- branches: [main, develop]
push:
- branches: [main, develop]
- workflow_dispatch:
-
-permissions:
- contents: write
- pull-requests: write
+ branches: [ main, master, develop ]
+ paths-ignore:
+ - 'README.md'
+ - '*.md'
+ - 'docs/**'
+ - 'CHANGELOG.md'
+ - 'CONTRIBUTING.md'
+ - 'CODE_OF_CONDUCT.md'
+ - 'CONTRIBUTORS.md'
+ - 'SECURITY.md'
+ - 'SUPPORT.md'
+ - 'LICENSE'
+ - 'cookbook/**/*.md'
+ pull_request:
+ branches: [ main, master, develop ]
+ paths-ignore:
+ - 'README.md'
+ - '*.md'
+ - 'docs/**'
+ - 'CHANGELOG.md'
+ - 'CONTRIBUTING.md'
+ - 'CODE_OF_CONDUCT.md'
+ - 'CONTRIBUTORS.md'
+ - 'SECURITY.md'
+ - 'SUPPORT.md'
+ - 'LICENSE'
+ - 'cookbook/**/*.md'
jobs:
format:
runs-on: ubuntu-latest
+
steps:
- - uses: actions/checkout@v4
-
- - uses: actions/setup-python@v5
- with:
- python-version: '3.11'
-
- - run: |
- pip install black isort
-
- - name: Check formatting
- if: github.event_name == 'pull_request'
- run: |
- black --check semantica/
- isort --check-only semantica/
-
- - name: Format code
- if: github.event_name != 'pull_request'
- run: |
- black semantica/
- isort semantica/
-
- - name: Create PR
- if: github.event_name != 'pull_request'
- uses: peter-evans/create-pull-request@v5
- with:
- commit-message: "Auto-format code"
- title: "Auto-format code"
- branch: format/auto-format
- delete-branch: true
+ - uses: actions/checkout@v4
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install black isort flake8 mypy
+
+ - name: Run Black
+ run: |
+ black --check --diff semantica/
+
+ - name: Run isort
+ run: |
+ isort --check-only --diff semantica/
+
+ - name: Run flake8
+ run: |
+ flake8 semantica/ --max-line-length=88 --extend-ignore=E203,W503
+
+ - name: Run mypy
+ run: |
+ mypy semantica/ || true