Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: ruff review
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: ruff check --config .ruff.toml --exclude "test/functional/test-framework/**/*.py" --exclude "doc/*" --exclude "doc/*" --output-format=github .
13 changes: 0 additions & 13 deletions .pep8speaks.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
line-length = 100

[lint]
ignore = [
"E402", # All module level imports should be at the top of the file. This means that there
# should be no statements in between module level imports
"F405", # Variable may be undefined, or defined from star imports
]
2 changes: 1 addition & 1 deletion test/functional/api/cas/casadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
PromotionPolicy,
)
from api.cas.casadm_params import OutputFormat, StatsFilter
from api.cas.cli import *
from api.cas.cli import * # noqa: F403
from api.cas.core import Core
from core.test_run import TestRun
from storage_devices.device import Device
Expand Down
4 changes: 2 additions & 2 deletions test/functional/api/cas/casadm_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from typing import List

from api.cas import casadm
from api.cas.cache_config import *
from api.cas.casadm_params import *
from api.cas.cache_config import * # noqa: F403
from api.cas.casadm_params import * # noqa: F403
from api.cas.core_config import CoreStatus
from api.cas.ioclass_config import IoClass
from api.cas.version import CasVersion
Expand Down
3 changes: 2 additions & 1 deletion test/functional/api/cas/casctl.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#
# Copyright(c) 2019-2021 Intel Corporation
# Copyright(c) 2025 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#

from .cli import *
from .cli import * # noqa: F403
from core.test_run import TestRun


Expand Down
2 changes: 1 addition & 1 deletion test/functional/tests/cli/test_cli_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from api.cas.cli_help_messages import *
from api.cas.cli_help_messages import * # noqa: F403
from api.cas.cli_messages import check_stderr_msg, check_stdout_msg
from core.test_run import TestRun

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from type_def.size import Size, Unit
from api.cas.cache_config import CacheLineSize, CacheMode
from api.cas.cli import standby_activate_cmd, standby_load_cmd
from api.cas.dmesg import get_md_section_size
from test_tools.dd import Dd
from test_tools.os_tools import sync
from test_utils.filesystem.file import File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools.fs_tools import Filesystem, create_directory
from .io_class_common import *
from .io_class_common import * # noqa: F403


@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
get_basic_workload,
mount_point,
)
from type_def.size import Unit

dirty_ratio_inertia_min, dirty_ratio_inertia_max = FlushParametersAlru.alru_params_range().dirty_ratio_inertia

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_many_lvms_on_single_core(update_initramfs_before_and_after_test):
- FIO with verification ran successfully.
- Configuration after reboot match configuration before.
"""
with TestRun.step(f"Create CAS device."):
with TestRun.step("Create CAS device."):
cache_dev = TestRun.disks['cache']
core_dev = TestRun.disks['core']
cache_dev.create_partitions([Size(8, Unit.GibiByte)])
Expand Down