Skip to content

Commit 077514a

Browse files
committed
add ruff check for whole project
1 parent ad411db commit 077514a

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
- name: Run Ruff
3737
run: |
38-
ruff check mytonctrl modules mytoninstaller mytoncore # wip adding ruff linting across the whole project
38+
ruff check
3939
4040
- name: Build project
4141
run: |

mytonctrl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import sys
88
import subprocess
9+
from mytonctrl.mytonctrl import run_migrations
910

1011
requirements_path = "/usr/src/mytonctrl/requirements.txt"
1112
if os.path.isfile(requirements_path):
@@ -16,8 +17,6 @@
1617
sys.path.insert(0, '/usr/bin/mytonctrl') # Add path to mytonctrl module
1718

1819

19-
from mytonctrl.mytonctrl import run_migrations
20-
2120
if __name__ == '__main__':
2221
print('Found new version of mytonctrl! Migrating!')
2322
run_migrations()

ruff.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
exclude = [
2+
"mypylib",
3+
"mypyconsole",
4+
"tests",
5+
]
6+
[lint]
7+
ignore = ["E741"]

scripts/install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def validate_digits_or_empty(value):
7575

7676
def validate_state_ttl(value, archive_ttl):
7777
v = validate_digits_or_empty(value)
78-
if v is not True: return v
78+
if v is not True:
79+
return v
7980
if archive_ttl and value and int(value) > int(archive_ttl):
8081
return "State TTL cannot be greater than blocks TTL"
8182
return True

tools/inject_backup_node_keys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run_vc(cmd: str):
3333
subprocess.run(f'tar -xzf {name} -C {tmp_dir}', shell=True)
3434

3535
subprocess.run(f'cp -rf {tmp_dir}/db/keyring /var/ton-work/db/', shell=True)
36-
subprocess.run(f'chown -R validator:validator /var/ton-work/db/keyring', shell=True)
36+
subprocess.run('chown -R validator:validator /var/ton-work/db/keyring', shell=True)
3737

3838
with open(f'{tmp_dir}/db/config.json', 'r') as f:
3939
config = json.load(f)
@@ -46,4 +46,4 @@ def run_vc(cmd: str):
4646
run_vc(f'addadnl {b64tohex(adnl["id"])} 0')
4747
run_vc(f'addvalidatoraddr {b64tohex(v["id"])} {b64tohex(adnl["id"])} {v["expire_at"]}')
4848

49-
subprocess.run(f'systemctl restart validator', shell=True)
49+
subprocess.run('systemctl restart validator', shell=True)

0 commit comments

Comments
 (0)