forked from rpms/leapp-repository
57 lines
3.0 KiB
Diff
57 lines
3.0 KiB
Diff
From 827e28de7b707f9fc458e1f5fdad9fffd7474abe Mon Sep 17 00:00:00 2001
|
|
From: Tomas Fratrik <tfratrik@redhat.com>
|
|
Date: Tue, 12 Aug 2025 16:59:01 +0200
|
|
Subject: [PATCH 31/55] pylint: enable consider-using-set-comprehension
|
|
|
|
Fixed occurrences of list comprehensions wrapped in set() by using
|
|
set comprehensions directly, removing disables for
|
|
consider-using-set-comprehension added for Python 2 compatibility.
|
|
|
|
Jira: RHELMISC-16038
|
|
---
|
|
.pylintrc | 1 -
|
|
.../checkconsumedassets/tests/test_asset_version_checking.py | 2 +-
|
|
.../common/actors/selinux/selinuxapplycustom/actor.py | 4 +---
|
|
3 files changed, 2 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/.pylintrc b/.pylintrc
|
|
index 5d75df40..e54d9a54 100644
|
|
--- a/.pylintrc
|
|
+++ b/.pylintrc
|
|
@@ -45,7 +45,6 @@ disable=
|
|
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
|
# new for python3 version of pylint
|
|
useless-object-inheritance,
|
|
- consider-using-set-comprehension, # pylint3 force to use comprehension in place we don't want (py2 doesnt have these options, for inline skip)
|
|
unnecessary-pass,
|
|
invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
|
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
|
diff --git a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
|
index 9c324b44..f37dcea4 100644
|
|
--- a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
|
+++ b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
|
@@ -44,4 +44,4 @@ def test_make_report_entries_with_unique_urls():
|
|
docs_url_to_title_map = {'/path/to/asset1': ['asset1_title1', 'asset1_title2'],
|
|
'/path/to/asset2': ['asset2_title']}
|
|
report_urls = check_consumed_assets_lib.make_report_entries_with_unique_urls(docs_url_to_title_map)
|
|
- assert set([ru.value['url'] for ru in report_urls]) == {'/path/to/asset1', '/path/to/asset2'}
|
|
+ assert {ru.value['url'] for ru in report_urls} == {'/path/to/asset1', '/path/to/asset2'}
|
|
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
|
index 4856f36a..db8fe8ac 100644
|
|
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
|
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
|
@@ -40,9 +40,7 @@ class SELinuxApplyCustom(Actor):
|
|
return
|
|
|
|
# get list of policy modules after the upgrade
|
|
- installed_modules = set(
|
|
- [module[0] for module in selinuxapplycustom.list_selinux_modules()]
|
|
- )
|
|
+ installed_modules = {module[0] for module in selinuxapplycustom.list_selinux_modules()}
|
|
|
|
# import custom SElinux modules
|
|
for semodules in self.consume(SELinuxModules):
|
|
--
|
|
2.51.1
|
|
|