Skip to content

Commit

Permalink
ci: Disable pylint E203 style and manual fix E0606
Browse files Browse the repository at this point in the history
pylint E203 conflicts with black style, so disable it, also manual fix
some E0606 issues after ruff format.

Signed-off-by: Yihuang Yu <[email protected]>
  • Loading branch information
PaulYuuu committed Aug 23, 2024
1 parent 42467dd commit d75de87
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
pip install -r requirements-ci.txt
- name: Run inspekt
if: ${{ matrix.python-version > 3.6 }}
run: inspekt checkall --disable-style E501,E265,W601,E402,E722,E741 --disable-lint=W,R,C,E0601,E1002,E1101,E1103,E1120,F0401,I0011,I1101 --enable-lint W0611,W1201 --no-license-check
run: inspekt checkall --disable-style E501,E265,W601,E402,E722,E741,E203 --disable-lint=W,R,C,E0601,E1002,E1101,E1103,E1120,F0401,I0011,I1101 --enable-lint W0611,W1201 --no-license-check
- name: Run inspekt (py36)
if: ${{ matrix.python-version == 3.6 }}
run: inspekt checkall --disable-style E501,E265,W601,E402,E722,E741 --disable-lint=W,R,C,E0012,E0601,E1002,E1101,E1103,E1120,F0401,I0011,I1101 --enable-lint W0611,W1201 --no-license-check
run: inspekt checkall --disable-style E501,E265,W601,E402,E722,E741,E203 --disable-lint=W,R,C,E0012,E0601,E1002,E1101,E1103,E1120,F0401,I0011,I1101 --enable-lint W0611,W1201 --no-license-check
- run: echo "This job's status is ${{ job.status }}."

commitlint:
Expand Down
4 changes: 2 additions & 2 deletions provider/cpu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def check_if_vm_vcpu_topology_match(session, os_type, cpuinfo, test, devices=Non
test.fail("Variable 'devices' must be defined for Windows guest.")

is_matched = (
cpuinfo.sockets == sockets and cpuinfo.cores == cores and threads_matched
) # pylint: disable=E0606
cpuinfo.sockets == sockets and cpuinfo.cores == cores and threads_matched # pylint: disable=E0606
)

if not is_matched:
LOG_JOB.debug("CPU infomation of guest:\n%s", out)
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/balloon_boot_in_pause.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def memory_check(self, step, changed_mem):
else:
guest_ballooned_mem = gmem - self.pre_gmem
if (mmem - self.pre_mem) != changed_mem or (
self.pre_gmem and abs(guest_ballooned_mem - changed_mem) > 100
): # pylint: disable=E0606
self.pre_gmem and abs(guest_ballooned_mem - changed_mem) > 100 # pylint: disable=E0606
):
self.error_report(step, self.pre_mem + changed_mem, mmem, gmem)
self.test.fail(f"Balloon test failed {step}")
return (mmem, gmem)
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/multi_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ def _get_data_disks():
key_word = params["check_result_key_word"]
output = session.cmd_output(cmd)
if iozone_options and n < iozone_target_num:
iozone.run(
iozone_options.format(orig_partition), # pylint: disable=E0606
iozone.run( # pylint: disable=E0606
iozone_options.format(orig_partition),
iozone_timeout,
)
if key_word not in output:
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/qmp_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def check_result(qmp_o, expect_o=None):
callback = {
"host_cmd": lambda cmd: process.system_output(cmd, shell=True).decode(),
"guest_cmd": session.cmd_output,
"qmp_cmd": qmp_port.send_args_cmd,
} # pylint: disable=E0606
"qmp_cmd": qmp_port.send_args_cmd, # pylint: disable=E0606
}

def send_cmd(cmd):
"""Helper to execute command on host/ssh guest/qmp monitor"""
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/vdpa_dpdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def run(test, params, env):

for nic_index, nic in enumerate(vm.virtnet):
if nic.nettype == "vdpa":
mac = "0," + nic.mac
mac = "0," + nic.mac # pylint: disable=E0606
ethname = utils_net.get_linux_ifname(session, nic.mac)
pci_id = utils_sriov.get_pci_from_iface(ethname, session).strip()
dpdk_utils.bind_pci_device_to_vfio(session, pci_id) # pylint: disable=E0606
dpdk_utils.bind_pci_device_to_vfio(session, pci_id)

guest = {
"host": vm.get_address(),
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/virtio_fs_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def run(test, params, env):
vol_con = f"VolumeName='{virtio_fs_disk_label}'"
volume_letter = utils_misc.wait_for(
lambda: utils_misc.get_win_disk_vol(session, condition=vol_con),
cmd_timeout,
) # pylint: disable=E0606
cmd_timeout, # pylint: disable=E0606
)
if volume_letter is None:
test.fail("Could not get virtio-fs mounted volume letter.")
fs_dest = f"{volume_letter}:"
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/virtio_fs_share_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ def start_multifs_instance():
vol_con = f"VolumeName='{virtio_fs_disk_label}'"
volume_letter = utils_misc.wait_for(
lambda: utils_misc.get_win_disk_vol(session, condition=vol_con),
cmd_timeout,
) # pylint: disable=E0606
cmd_timeout, # pylint: disable=E0606
)
if volume_letter is None:
test.fail("Could not get virtio-fs mounted volume letter.")
fs_dest = f"{volume_letter}:"
Expand Down
6 changes: 3 additions & 3 deletions qemu/tests/virtio_net_dpdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def result(recode, dst):
session,
generator1,
generator2,
mac,
port,
exec_file, # pylint: disable=E0606
mac, # pylint: disable=E0606
port, # pylint: disable=E0606
exec_file,
nic1_driver,
nic2_driver,
whitelist_option,
Expand Down

0 comments on commit d75de87

Please sign in to comment.