Skip to content

Commit 9f3e7b7

Browse files
Merge pull request #1695 from Kamoppl/kamilg/pep8_fix
github-actions: update code style checker for python
2 parents f39fa50 + 61e24fc commit 9f3e7b7

File tree

11 files changed

+34
-22
lines changed

11 files changed

+34
-22
lines changed

.github/workflows/ruff.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: ruff review
2+
on: [pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: Install Python
9+
uses: actions/setup-python@v5
10+
with:
11+
python-version: "3.11"
12+
- name: Install dependencies
13+
run: |
14+
python -m pip install --upgrade pip
15+
pip install ruff
16+
# Update output format to enable automatic inline annotations.
17+
- name: Run Ruff
18+
run: ruff check --config .ruff.toml --exclude "test/functional/test-framework/**/*.py" --exclude "doc/*" --exclude "doc/*" --output-format=github .

.pep8speaks.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.ruff.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
line-length = 100
2+
3+
[lint]
4+
ignore = [
5+
"E402", # All module level imports should be at the top of the file. This means that there
6+
# should be no statements in between module level imports
7+
"F405", # Variable may be undefined, or defined from star imports
8+
]

test/functional/api/cas/casadm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
PromotionPolicy,
1717
)
1818
from api.cas.casadm_params import OutputFormat, StatsFilter
19-
from api.cas.cli import *
19+
from api.cas.cli import * # noqa: F403
2020
from api.cas.core import Core
2121
from core.test_run import TestRun
2222
from storage_devices.device import Device

test/functional/api/cas/casadm_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from typing import List
1313

1414
from api.cas import casadm
15-
from api.cas.cache_config import *
16-
from api.cas.casadm_params import *
15+
from api.cas.cache_config import * # noqa: F403
16+
from api.cas.casadm_params import * # noqa: F403
1717
from api.cas.core_config import CoreStatus
1818
from api.cas.ioclass_config import IoClass
1919
from api.cas.version import CasVersion

test/functional/api/cas/casctl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#
22
# Copyright(c) 2019-2021 Intel Corporation
3+
# Copyright(c) 2025 Huawei Technologies Co., Ltd.
34
# SPDX-License-Identifier: BSD-3-Clause
45
#
56

6-
from .cli import *
7+
from .cli import * # noqa: F403
78
from core.test_run import TestRun
89

910

test/functional/tests/cli/test_cli_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from api.cas.cli_help_messages import *
9+
from api.cas.cli_help_messages import * # noqa: F403
1010
from api.cas.cli_messages import check_stderr_msg, check_stdout_msg
1111
from core.test_run import TestRun
1212

test/functional/tests/fault_injection/test_fault_injection_standby.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from type_def.size import Size, Unit
1414
from api.cas.cache_config import CacheLineSize, CacheMode
1515
from api.cas.cli import standby_activate_cmd, standby_load_cmd
16-
from api.cas.dmesg import get_md_section_size
1716
from test_tools.dd import Dd
1817
from test_tools.os_tools import sync
1918
from test_utils.filesystem.file import File

test/functional/tests/io_class/test_io_class_eviction_priority.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
1313
from test_tools.fs_tools import Filesystem, create_directory
14-
from .io_class_common import *
14+
from .io_class_common import * # noqa: F403
1515

1616

1717
@pytest.mark.require_disk("cache", DiskTypeSet([DiskType.optane, DiskType.nand]))

test/functional/tests/security/fuzzy/kernel/fuzzy_with_io/fuzzy_set_param/test_fuzzy_set_param_cleaning_alru_dirty_ratio_inertia.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
get_basic_workload,
2828
mount_point,
2929
)
30-
from type_def.size import Unit
3130

3231
dirty_ratio_inertia_min, dirty_ratio_inertia_max = FlushParametersAlru.alru_params_range().dirty_ratio_inertia
3332

0 commit comments

Comments
 (0)