This is an automated email from the ASF dual-hosted git repository.

hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-pycasbin.git


The following commit(s) were added to refs/heads/master by this push:
     new c5d4506  ci: replace super-linter with direct black check
c5d4506 is described below

commit c5d45060d14bcb02990b1b11e902a9ae2a0bb22c
Author: Yang Luo <[email protected]>
AuthorDate: Tue Aug 4 14:21:11 2026 +0800

    ci: replace super-linter with direct black check
---
 .github/workflows/build.yml | 19 +++++++++----------
 casbin/model/model.py       |  8 +++++---
 casbin/synced_enforcer.py   |  1 -
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7ac55df..921e3af 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -54,18 +54,17 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v4
+
+      - name: Set up Python
+        uses: actions/setup-python@v5
         with:
-          fetch-depth: 0
+          python-version: "3.12"
 
-      - name: Super-Linter
-        uses: super-linter/[email protected]
-        env:
-          VALIDATE_ALL_CODEBASE: false
-          VALIDATE_PYTHON_BLACK: true
-          DEFAULT_BRANCH: master
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          LINTER_RULES_PATH: /
-          PYTHON_BLACK_CONFIG_FILE: pyproject.toml
+      - name: Install black
+        run: pip install "$(grep '^black==' requirements_dev.txt)"
+
+      - name: Check formatting with black
+        run: black --check --diff .
 
   coveralls:
     name: Indicate completion to coveralls.io
diff --git a/casbin/model/model.py b/casbin/model/model.py
index ecef775..e75572c 100644
--- a/casbin/model/model.py
+++ b/casbin/model/model.py
@@ -126,9 +126,11 @@ class Model(Policy):
 
             assertion.policy = sorted(
                 assertion.policy,
-                key=lambda x: int(x[assertion.priority_index])
-                if x[assertion.priority_index].isdigit()
-                else x[assertion.priority_index],
+                key=lambda x: (
+                    int(x[assertion.priority_index])
+                    if x[assertion.priority_index].isdigit()
+                    else x[assertion.priority_index]
+                ),
             )
 
             for i, policy in enumerate(assertion.policy):
diff --git a/casbin/synced_enforcer.py b/casbin/synced_enforcer.py
index c5982c6..207f793 100644
--- a/casbin/synced_enforcer.py
+++ b/casbin/synced_enforcer.py
@@ -36,7 +36,6 @@ class AtomicBool:
 
 
 class SyncedEnforcer:
-
     """SyncedEnforcer wraps Enforcer and provides synchronized access.
     It's also a drop-in replacement for Enforcer"""
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to