Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4f14a31

Browse filesBrowse files
committed
chore: add ruff format --check
1 parent 7c8e5c9 commit 4f14a31
Copy full SHA for 4f14a31

File tree

174 files changed

+4649
-3100
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

174 files changed

+4649
-3100
lines changed

‎.github/workflows/ci.yaml

Copy file name to clipboardExpand all lines: .github/workflows/ci.yaml
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ jobs:
327327
run: python -m pip install ruff==0.11.8
328328
- name: Ensure docs generate no warnings
329329
run: cargo doc
330-
- name: run python lint
331-
run: ruff check
330+
- name: run ruff check
331+
run: ruff check --diff
332+
- name: run ruff format
333+
run: ruff format --check
332334
- name: install prettier
333335
run: yarn global add prettier && echo "$(yarn global bin)" >>$GITHUB_PATH
334336
- name: check wasm code with prettier

‎examples/atexit_example.py

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import atexit
22
import sys
33

4+
45
def myexit():
56
sys.exit(2)
67

8+
79
atexit.register(myexit)
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
from rust_py_module import RustStruct, rust_function
22

3+
34
class PythonPerson:
45
def __init__(self, name):
56
self.name = name
67

8+
79
def python_callback():
810
python_person = PythonPerson("Peter Python")
911
rust_object = rust_function(42, "This is a python string", python_person)
1012
print("Printing member 'numbers' from rust struct: ", rust_object.numbers)
1113
rust_object.print_in_rust_from_python()
1214

15+
1316
def take_string(string):
1417
print("Calling python function from rust with string: " + string)

‎examples/freeze/freeze.py

Copy file name to clipboard
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import time
22

33
print("Hello world!!!", time.time())
4-

‎extra_tests/benchmarks/perf_fib.py

Copy file name to clipboardExpand all lines: extra_tests/benchmarks/perf_fib.py
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ def fib(n):
22
a = 1
33
b = 1
44
for _ in range(n - 1):
5-
temp = b
6-
b = a + b
7-
a = temp
5+
temp = b
6+
b = a + b
7+
a = temp
88

99
return b
1010

11+
1112
print(fib(1))
1213
print(fib(2))
1314
print(fib(3))
1415
print(fib(4))
15-
print(fib(5))
16+
print(fib(5))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.