Skip to content

Commit

Permalink
Fixed formatting (#172)
Browse files Browse the repository at this point in the history
* Fixed formating
* Updated workflow to use PR code
* Updated workflow to use branch code
  • Loading branch information
yuce authored Oct 6, 2024
1 parent 2a95725 commit 816ff95
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ jobs:

steps:

- uses: "actions/checkout@v4"
- name: "Checkout PR"
uses: "actions/checkout@v4"
if: github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: "Checkout Branch"
uses: "actions/checkout@v4"
if: github.event_name == 'push'

- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v5"
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ upload:
check:
ruff format --check
ruff check

reformat:
ruff format
6 changes: 3 additions & 3 deletions src/pyswip/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@


class PySwipError(Exception):

def __init__(self, message):
super().__init__(message)


class SwiPrologNotFoundError(PySwipError):

def __init__(self, message="SWI-Prolog not found"):
super().__init__(message)

Expand Down Expand Up @@ -188,7 +186,9 @@ def _find_swipl_windows():
# libswipl.dll must be in SWI_DIR/bin
libswipl_path = os.path.join(swi_dir, "bin", libswipl)
if not os.path.exists(libswipl_path):
raise SwiPrologNotFoundError(f"could not locate {libswipl} at {libswipl_path}")
raise SwiPrologNotFoundError(
f"could not locate {libswipl} at {libswipl_path}"
)
return libswipl_path, swi_dir

raise SwiPrologNotFoundError
Expand Down
1 change: 1 addition & 0 deletions tests/test_prolog.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"""
Tests the Prolog class.
"""

import os.path
import unittest

Expand Down

0 comments on commit 816ff95

Please sign in to comment.