Skip to content

Commit 29fe80d

Browse files
Merge pull request #129 from piotr-roslaniec/ruff
2 parents 8776986 + 2307d54 commit 29fe80d

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

.github/workflows/umbral-pre.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ jobs:
130130
working-directory: umbral-pre-python
131131

132132
- name: Install pip dependencies
133-
run: pip install mypy
133+
run: pip install mypy ruff
134134

135135
- name: Run mypy.stubtest
136136
run: python -m mypy.stubtest umbral_pre --allowlist stubtest-allowlist.txt
137137
working-directory: umbral-pre-python
138138

139+
- name: Run ruff
140+
run: ruff check --output-format=github umbral_pre
141+
working-directory: umbral-pre-python
142+
139143
trigger-wheels:
140144
runs-on: ubuntu-latest
141145
needs: test

umbral-pre-python/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[build-system]
22
requires = ["setuptools", "wheel", "setuptools-rust"]
3+
4+
[tool.ruff]
5+
exclude = ["umbral_pre/__init__.py"] # false-positive unused-import
6+
select = ["E", "F", "I"]

umbral-pre-python/umbral_pre/__init__.pyi

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from typing import Optional, Tuple, List, final, Sequence
2-
1+
from typing import List, Optional, Sequence, Tuple, final
32

43
@final
54
class SecretKey:
@@ -55,7 +54,10 @@ class PublicKey:
5554
...
5655

5756
@staticmethod
58-
def recover_from_prehash(prehash: bytes, signature: RecoverableSignature) -> PublicKey:
57+
def recover_from_prehash(
58+
prehash: bytes,
59+
signature: RecoverableSignature
60+
) -> PublicKey:
5961
...
6062

6163

@@ -122,7 +124,11 @@ def encrypt(delegating_pk: PublicKey, plaintext: bytes) -> Tuple[Capsule, bytes]
122124
...
123125

124126

125-
def decrypt_original(delegating_sk: SecretKey, capsule: Capsule, ciphertext: bytes) -> bytes:
127+
def decrypt_original(
128+
delegating_sk: SecretKey,
129+
capsule: Capsule,
130+
ciphertext: bytes
131+
) -> bytes:
126132
...
127133

128134

0 commit comments

Comments
 (0)