aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVirgil Dupras <hsoft@hardcoded.net>2018-08-14 11:14:09 -0400
committerVirgil Dupras <hsoft@hardcoded.net>2018-08-14 11:14:09 -0400
commit23368d93037c7134847e99ff9772e2e2fbc9daa3 (patch)
tree74e5ecb11b744d2b576b1a5da4fb6895246fe6c3 /pym/gentoolkit/eshowkw
parentRemove gentoolkit.deprecated (diff)
downloadgentoolkit-23368d93037c7134847e99ff9772e2e2fbc9daa3.tar.gz
gentoolkit-23368d93037c7134847e99ff9772e2e2fbc9daa3.tar.bz2
gentoolkit-23368d93037c7134847e99ff9772e2e2fbc9daa3.zip
Add (and fix) flake8 checks in tox
Add config in tox to run flake8 checks. For now, only "F*" errors are checked (errors reported by pyflakes). pep8 style checks are ignored for now. This is accompanied by changes in the code that are necessary to silence these errors. Most of them were about unused imports, but also unsed referenced and even undefined ones (meaning that this code path was broken, gotta increase test coverage). This setup will replace pylint which reports way too many errors to be usable (see next commit).
Diffstat (limited to 'pym/gentoolkit/eshowkw')
-rw-r--r--pym/gentoolkit/eshowkw/keywords_content.py2
-rw-r--r--pym/gentoolkit/eshowkw/keywords_header.py11
2 files changed, 9 insertions, 4 deletions
diff --git a/pym/gentoolkit/eshowkw/keywords_content.py b/pym/gentoolkit/eshowkw/keywords_content.py
index 18926b4..786e8b9 100644
--- a/pym/gentoolkit/eshowkw/keywords_content.py
+++ b/pym/gentoolkit/eshowkw/keywords_content.py
@@ -166,8 +166,6 @@ class keywords_content:
Sort packages queried based on version and slot
%% pn , repo, slot, eapi, keywords
"""
- from operator import itemgetter
-
if len(package_content) > 1:
ver_map = {}
for cpv in package_content:
diff --git a/pym/gentoolkit/eshowkw/keywords_header.py b/pym/gentoolkit/eshowkw/keywords_header.py
index 6557f60..ab9117e 100644
--- a/pym/gentoolkit/eshowkw/keywords_header.py
+++ b/pym/gentoolkit/eshowkw/keywords_header.py
@@ -2,6 +2,8 @@
# Copyright 2001-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+from __future__ import print_function
+
__all__ = ['keywords_header']
import portage
@@ -9,12 +11,17 @@ import os
import sys
if sys.hexversion < 0x3000000:
from io import open
-from portage import _encodings, _unicode_decode, _unicode_encode
+from portage import _encodings, _unicode_encode
from portage import settings as ports
-from portage.output import colorize
from gentoolkit.eshowkw.display_pretty import colorize_string
from gentoolkit.eshowkw.display_pretty import align_string
+# Copied from ekeyword
+def warning(msg):
+ """Write |msg| as a warning to stderr"""
+ print('warning: %s' % msg, file=sys.stderr)
+
+
# Copied from ekeyword, modified to support arch vs ~arch status
def load_profile_data(portdir=None, repo='gentoo'):
"""Load the list of known arches from the tree