Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add ruff formatting and linting #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2024
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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ jobs:
path: "dist/*"
if-no-files-found: error

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depths: 0
- uses: actions/setup-python@v4
- name: Install Ruff
run: pip install ruff
- name: Check format
run: ruff format --check
- name: Check lints
run: ruff check

test:
runs-on: ${{ matrix.os }}
needs: build
Expand Down
2 changes: 1 addition & 1 deletion clr_loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_mono(
jit_options: Optional[Sequence[str]] = None,
assembly_dir: Optional[str] = None,
config_dir: Optional[str] = None,
set_signal_chaining: bool = False
set_signal_chaining: bool = False,
) -> Runtime:
"""Get a Mono runtime instance

Expand Down
3 changes: 2 additions & 1 deletion clr_loader/mono.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class MethodDesc:
def __init__(self, typename, function):
self._desc = f"{typename}:{function}"
self._ptr = _MONO.mono_method_desc_new(
self._desc.encode("utf8"), 1 # include_namespace
self._desc.encode("utf8"),
1, # include_namespace
)

def search(self, image):
Expand Down
3 changes: 2 additions & 1 deletion clr_loader/util/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ def find_libmono(*, assembly_dir: str = None, sgen: bool = True) -> Path:
)

else:
if assembly_dir == None:
if assembly_dir is None:
from ctypes.util import find_library

path = find_library(unix_name)
else:
libname = "lib" + unix_name + ".so"
Expand Down
7 changes: 4 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import sys
from pathlib import Path

project = "clr-loader"
copyright = "2022, Benedikt Reinartz"
author = "Benedikt Reinartz"

extensions = ["sphinx.ext.autodoc"]

# Add parent to path for autodoc
import sys, os

sys.path.append(os.path.abspath(".."))
sys.path.append(str(Path("..").absolute()))

# autodoc_typehints = "both"

Expand Down
1 change: 0 additions & 1 deletion tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import shutil
import pytest
from subprocess import check_call
import os
import sys
from pathlib import Path

Expand Down