Skip to content

Commit

Permalink
Fix pylint errors.
Browse files Browse the repository at this point in the history
Addressing
************* Module swidtags
lib/dnf-plugins/swidtags.py:166:4: E1200: Unsupported logging format character 'p' (0x70) at index 33 (logging-unsupported-format)
lib/dnf-plugins/swidtags.py:249:50: E0602: Undefined variable 'file' (undefined-variable)
************* Module swidq
lib/swidq/__init__.py:34:1: E0101: Explicit return in __init__ (return-in-init)
  • Loading branch information
adelton committed Apr 18, 2019
1 parent fe30070 commit dfad3c5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include test.sh LICENSE
include test.sh LICENSE Makefile
recursive-include tests *
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ spec:
test:
./test.sh

test-pylint:
pylint-3 -E lib/*/*.py setup.py

clean:
rm -rf $(shell cat .gitignore)

2 changes: 1 addition & 1 deletion bdist_rpm/install_script
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ python3 setup.py install --single-version-externally-managed -O1 --root=$RPM_BUI
sed -i 's#^/etc#%config(noreplace) /etc#' INSTALLED_FILES

%check
./test.sh
make test-pylint test

%post

Expand Down
4 changes: 2 additions & 2 deletions lib/dnf-plugins/swidtags.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def transaction(self):
remove_packages = {}
for p in self.remove_set:
if p not in self.remove_set_checksum:
logger.warning("Could not identify checksum for %p, potential SWID tag will not be removed", p)
logger.warning("Could not identify checksum for %s, potential SWID tag will not be removed", p)
continue
remove_packages[self.remove_set_checksum[p]] = True
if len(remove_packages) > 0:
Expand Down Expand Up @@ -246,7 +246,7 @@ def purge_generated_dir(self):
unlink(path.join(self.dir_generated, f))
count += 1
except OSError as e:
logger.warning("Failed to remove [%s]: %s" % (file, e))
logger.warning("Failed to remove [%s]: %s" % (f, e))
try:
rmdir(self.dir_generated)
except OSError:
Expand Down
2 changes: 1 addition & 1 deletion lib/swidq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, file=None, copy_from=None):
if copy_from:
self.__dict__ = deepcopy(copy_from.__dict__)
else:
return self._load_from_file( file)
self._load_from_file( file)

def _load_from_file(self, file):
self.path = file
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bdist_rpm]
requires = python3-rpm python3-lxml dnf-plugins-core xmlsec1-openssl
build_requires = python3 python3-setuptools python3-rpm python3-lxml openssl xmlsec1-openssl createrepo_c fakechroot fakeroot dnf dnf-plugins-core gzip gnupg2
build_requires = python3 python3-setuptools python3-rpm python3-lxml openssl xmlsec1-openssl createrepo_c fakechroot fakeroot dnf dnf-plugins-core gzip gnupg2 python3-pylint
release = 1%%{dist}
obsoletes = dnf-plugin-swidtags swid-tools

0 comments on commit dfad3c5

Please sign in to comment.