Skip to content

Commit 18ae71d

Browse files
radekholy24Ales Kozumplik
authored andcommitted
lint: fix convention violations in the new source files
1 parent 64cd6ee commit 18ae71d

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

dnf/cli/commands/updateinfo.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,14 @@ def _list(apkg_adv_insts):
207207
@classmethod
208208
def display_list(cls, apkg_adv_insts, mixed, description):
209209
"""Display the list of advisories."""
210-
nevrainst_id2types = cls._list(apkg_adv_insts)
211210
# Sort IDs and convert types to labels.
212-
inst2mark = lambda ins: '' if not mixed else 'i ' if ins else ' '
211+
inst2mark = lambda inst: '' if not mixed else 'i ' if inst else ' '
213212
nevramark2id2tlbl = OrderedDict(
214213
((nevra, inst2mark(inst)),
215214
OrderedDict(sorted(((id_, cls.TYPE2LABEL[typ])
216215
for id_, typ in id2type.items()),
217216
key=itemgetter(0))))
218-
for (nevra, inst), id2type in nevrainst_id2types)
217+
for (nevra, inst), id2type in cls._list(apkg_adv_insts))
219218
if not nevramark2id2tlbl:
220219
return
221220
# Get all advisory IDs and types as two iterables.
@@ -285,7 +284,7 @@ def display_info(self, apkg_adv_insts, mixed, description):
285284
info = self._info(apkg_adv_insts).items()
286285
# Convert objects to string lines and mark verbose fields.
287286
verbse = lambda value: value if self.base.conf.verbose else None
288-
title_vallines = (
287+
info = (
289288
(tit, ([id_], [self.TYPE2LABEL[typ]], [unicode(upd)],
290289
(id_title[0] + ' - ' + id_title[1] for id_title in bzs),
291290
(id_title[0] for id_title in cvs), desc.splitlines(),
@@ -296,7 +295,7 @@ def display_info(self, apkg_adv_insts, mixed, description):
296295
_('CVEs'), _('Description'), _('Rights'), _('Files'),
297296
_('Installed'))
298297
width = _maxlen(labels)
299-
for title, vallines in title_vallines:
298+
for title, vallines in info:
300299
print('=' * 79)
301300
print(' ' + title)
302301
print('=' * 79)

scripts/pylint_false_positives

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
^E1101: dnf.repo:[0-9,: ]*Instance of 'PackagePayload' has no '_target_params' member$
1717
^W0201: dnf.repo:[0-9,: ]*Attribute '[_a-z]+' defined outside __init__$
1818
^W0212: tests[ a-z0-9,._:]*Access to a protected member .*$
19+
^W0613: dnf.cli.commands.updateinfo:[0-9,: ]*Unused argument 'description'$
20+
^W0613: dnf.cli.commands.updateinfo:[0-9,: ]*Unused argument 'mixed'$

tests/cli/commands/test_updateinfo.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _stub_print(self, *objects):
5454
"""Pretend to print to standard output."""
5555
print(*objects, file=self._stdout)
5656

57-
def test_available_apkg_adv_insts_filter_packages(self):
57+
def test_avail_filter_pkgs(self):
5858
"""Test querying with an packages filter."""
5959
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
6060
cmd.refresh_installed_cache()
@@ -66,7 +66,7 @@ def test_available_apkg_adv_insts_filter_packages(self):
6666
'incorrect pairs')
6767
cmd.clear_installed_cache()
6868

69-
def test_available_apkg_adv_insts_filter_packages_nonexistent(self):
69+
def test_avail_filter_pkgs_nonex(self):
7070
"""Test querying with a non-existent packages filter."""
7171
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
7272
cmd.refresh_installed_cache()
@@ -77,7 +77,7 @@ def test_available_apkg_adv_insts_filter_packages_nonexistent(self):
7777
[], 'incorrect pairs')
7878
cmd.clear_installed_cache()
7979

80-
def test_available_apkg_adv_insts_filter_security(self):
80+
def test_avail_filter_security(self):
8181
"""Test querying with a security filter."""
8282
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
8383
cmd.refresh_installed_cache()
@@ -89,7 +89,7 @@ def test_available_apkg_adv_insts_filter_security(self):
8989
'incorrect pairs')
9090
cmd.clear_installed_cache()
9191

92-
def test_installed_apkg_adv_insts(self):
92+
def test_inst(self):
9393
"""Test installed triplets querying."""
9494
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
9595
cmd.refresh_installed_cache()
@@ -102,7 +102,7 @@ def test_installed_apkg_adv_insts(self):
102102
'incorrect pairs')
103103
cmd.clear_installed_cache()
104104

105-
def test_installed_apkg_adv_insts_filter_bugfix(self):
105+
def test_inst_filter_bugfix(self):
106106
"""Test querying with a bugfix filter."""
107107
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
108108
cmd.refresh_installed_cache()
@@ -114,7 +114,7 @@ def test_installed_apkg_adv_insts_filter_bugfix(self):
114114
'incorrect pairs')
115115
cmd.clear_installed_cache()
116116

117-
def test_installed_apkg_adv_insts_filter_enhancement(self):
117+
def test_inst_filter_enhancement(self):
118118
"""Test querying with an enhancement filter."""
119119
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
120120
cmd.refresh_installed_cache()
@@ -126,7 +126,7 @@ def test_installed_apkg_adv_insts_filter_enhancement(self):
126126
'incorrect pairs')
127127
cmd.clear_installed_cache()
128128

129-
def test_updating_apkg_adv_insts(self):
129+
def test_upd(self):
130130
"""Test updating triplets querying."""
131131
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
132132
cmd.refresh_installed_cache()
@@ -138,7 +138,7 @@ def test_updating_apkg_adv_insts(self):
138138
'incorrect pairs')
139139
cmd.clear_installed_cache()
140140

141-
def test_all_apkg_adv_insts(self):
141+
def test_all(self):
142142
"""Test all triplets querying."""
143143
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
144144
cmd.refresh_installed_cache()
@@ -151,7 +151,7 @@ def test_all_apkg_adv_insts(self):
151151
('tour-5-1.noarch.rpm', 'DNF-2014-3', False)])
152152
cmd.clear_installed_cache()
153153

154-
def test_all_apkg_adv_insts_filter_advisories(self):
154+
def test_all_filter_advisories(self):
155155
"""Test querying with an advisories filter."""
156156
cmd = dnf.cli.commands.updateinfo.UpdateInfoCommand(self.cli)
157157
cmd.refresh_installed_cache()

0 commit comments

Comments
 (0)