Skip to content

Commit 816ff95

Browse files
authored
Fixed formatting (#172)
* Fixed formating * Updated workflow to use PR code * Updated workflow to use branch code
1 parent 2a95725 commit 816ff95

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.github/workflows/tests.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ jobs:
2323

2424
steps:
2525

26-
- uses: "actions/checkout@v4"
26+
- name: "Checkout PR"
27+
uses: "actions/checkout@v4"
28+
if: github.event_name == 'pull_request_target'
29+
with:
30+
ref: refs/pull/${{ github.event.pull_request.number }}/merge
31+
32+
- name: "Checkout Branch"
33+
uses: "actions/checkout@v4"
34+
if: github.event_name == 'push'
2735

2836
- name: "Set up Python ${{ matrix.python-version }}"
2937
uses: "actions/setup-python@v5"

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ upload:
2121
check:
2222
ruff format --check
2323
ruff check
24+
25+
reformat:
26+
ruff format

src/pyswip/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@
3939

4040

4141
class PySwipError(Exception):
42-
4342
def __init__(self, message):
4443
super().__init__(message)
4544

4645

4746
class SwiPrologNotFoundError(PySwipError):
48-
4947
def __init__(self, message="SWI-Prolog not found"):
5048
super().__init__(message)
5149

@@ -188,7 +186,9 @@ def _find_swipl_windows():
188186
# libswipl.dll must be in SWI_DIR/bin
189187
libswipl_path = os.path.join(swi_dir, "bin", libswipl)
190188
if not os.path.exists(libswipl_path):
191-
raise SwiPrologNotFoundError(f"could not locate {libswipl} at {libswipl_path}")
189+
raise SwiPrologNotFoundError(
190+
f"could not locate {libswipl} at {libswipl_path}"
191+
)
192192
return libswipl_path, swi_dir
193193

194194
raise SwiPrologNotFoundError

tests/test_prolog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"""
2626
Tests the Prolog class.
2727
"""
28+
2829
import os.path
2930
import unittest
3031

0 commit comments

Comments
 (0)