Skip to content

Commit 6b0fbb0

Browse files
CI: Verification with ruff is added (#29)
* A ruff-problems are fixed * LocalOperations: a call of subprocess.Popen is fixed (typing.Dict[str, typing.Any]) * CI: Verification with ruff is added
1 parent f5e3da1 commit 6b0fbb0

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

.github/workflows/package-verification.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install flake8 flake8-pyproject
30+
python -m pip install flake8 flake8-pyproject ruff
3131
- name: Lint with flake8
3232
run: |
3333
flake8 .
34+
- name: Lint with ruff
35+
run: |
36+
ruff check .
3437
3538
test:
3639
runs-on: ubuntu-latest

src/local_ops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _run_command__nt(
107107

108108
# TODO: why don't we use the data from input?
109109

110-
extParams: typing.Dict[str, str] = dict()
110+
extParams: typing.Dict[str, typing.Any] = dict()
111111

112112
if exec_env is None:
113113
pass
@@ -166,7 +166,7 @@ def _run_command__generic(
166166

167167
assert input_prepared is None or type(input_prepared) is bytes
168168

169-
extParams: typing.Dict[str, str] = dict()
169+
extParams: typing.Dict[str, typing.Any] = dict()
170170

171171
if exec_env is None:
172172
pass
@@ -198,7 +198,7 @@ def _run_command__generic(
198198
cwd=cwd,
199199
**extParams
200200
)
201-
assert not (process is None)
201+
assert process is not None
202202
if get_process:
203203
return process, None, None
204204
try:

src/remote_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def exec_command(
140140
ssh_cmd = ['ssh', self.ssh_dest] + self.ssh_args + [cmdline]
141141

142142
process = subprocess.Popen(ssh_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
143-
assert not (process is None)
143+
assert process is not None
144144
if get_process:
145145
return process
146146

tests/test_os_ops_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def LOG_INFO(template: str, *args) -> None:
10141014
LOG_INFO("HELLO! I am here!")
10151015

10161016
for num in range(cNumbers):
1017-
assert not (num in reservedNumbers)
1017+
assert num not in reservedNumbers
10181018

10191019
file_path = MAKE_PATH(lock_dir, num)
10201020

@@ -1150,7 +1150,7 @@ class tadWorkerData:
11501150
logging.info("OK. Let's check reservedNumbers!")
11511151

11521152
for n in range(N_NUMBERS):
1153-
if not (n in reservedNumbers.keys()):
1153+
if n not in reservedNumbers.keys():
11541154
nErrors += 1
11551155
logging.error("Number {} is not reserved!".format(n))
11561156
continue

0 commit comments

Comments
 (0)