Skip to content

Commit

Permalink
removed pycodestyle from build scripts/tox/README
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislit committed Oct 24, 2018
1 parent f90bec4 commit 2d77ac9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
10 changes: 5 additions & 5 deletions README.rst
Expand Up @@ -9,7 +9,7 @@ Abydos
+------------------+------------------------------------------------------+
| Dependencies | |requires| |snyk| |pyup| |fossa| |
+------------------+------------------------------------------------------+
| Local Analysis | |pylint| |pycodestyle| |flake8| |
| Local Analysis | |pylint| |flake8| |black| |
+------------------+------------------------------------------------------+
| Usage | |docs| |mybinder| |license| |sourcerank| |zenodo| |
+------------------+------------------------------------------------------+
Expand Down Expand Up @@ -80,14 +80,14 @@ Abydos
:target: #
:alt: Pylint Score

.. |pycodestyle| image:: https://img.shields.io/badge/pycodestyle-0-brightgreen.svg
:target: #
:alt: pycodestyle Errors

.. |flake8| image:: https://img.shields.io/badge/flake8-3-green.svg
:target: #
:alt: flake8 Errors

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: black

.. |docs| image:: https://readthedocs.org/projects/abydos/badge/?version=latest
:target: https://abydos.readthedocs.org/en/latest/
:alt: Documentation Status
Expand Down
40 changes: 20 additions & 20 deletions badge_update.py
Expand Up @@ -41,16 +41,16 @@ def pylint_color(score):
return BADGE_COLORS[-1]


def pycodestyle_color(score):
"""Return pycodestyle badge color."""
# These are the score cutoffs for each color above.
# I.e. score==0 -> brightgreen, down to 100 < score <= 200 -> orange
score_cutoffs = (0, 20, 50, 100, 200)
for i in range(len(score_cutoffs)):
if score <= score_cutoffs[i]:
return BADGE_COLORS[i]
# and score > 200 -> red
return BADGE_COLORS[-1]
# def pycodestyle_color(score):
# """Return pycodestyle badge color."""
# # These are the score cutoffs for each color above.
# # I.e. score==0 -> brightgreen, down to 100 < score <= 200 -> orange
# score_cutoffs = (0, 20, 50, 100, 200)
# for i in range(len(score_cutoffs)):
# if score <= score_cutoffs[i]:
# return BADGE_COLORS[i]
# # and score > 200 -> red
# return BADGE_COLORS[-1]


def flake8_color(score):
Expand All @@ -76,11 +76,11 @@ def flake8_color(score):
r' (-?[0-9\.]+)',
pylint_text).group(1)), 0.0)

if not os.path.isfile('./pycodestyle.log'):
exit('Please direct pycodestyle output to pycodestyle.log')
pycodestyle_text = open('pycodestyle.log', 'r', encoding='utf-8').read()
pycodestyle_score = sum(int(n) for n in re.findall(r'\n([0-9]+) +',
pycodestyle_text))
# if not os.path.isfile('./pycodestyle.log'):
# exit('Please direct pycodestyle output to pycodestyle.log')
# pycodestyle_text = open('pycodestyle.log', 'r', encoding='utf-8').read()
# pycodestyle_score = sum(int(n) for n in re.findall(r'\n([0-9]+) +',
# pycodestyle_text))

if not os.path.isfile('./flake8.log'):
exit('Please direct flake8 output to flake8.log')
Expand All @@ -95,11 +95,11 @@ def flake8_color(score):
pylint_color(pylint_score),
readme_text, 1)

prefix = 'https://img.shields.io/badge/pycodestyle-'
readme_text = re.sub(prefix + r'([0-9\.]+-[a-z]+)',
prefix + str(pycodestyle_score) + '-' +
pycodestyle_color(pycodestyle_score),
readme_text, 1)
# prefix = 'https://img.shields.io/badge/pycodestyle-'
# readme_text = re.sub(prefix + r'([0-9\.]+-[a-z]+)',
# prefix + str(pycodestyle_score) + '-' +
# pycodestyle_color(pycodestyle_score),
# readme_text, 1)

prefix = 'https://img.shields.io/badge/flake8-'
readme_text = re.sub(prefix + r'([0-9\.]+-[a-z]+)',
Expand Down
4 changes: 3 additions & 1 deletion btest.sh
Expand Up @@ -22,6 +22,8 @@ if [ "$clean" = "1" ]; then
fi

if [ "$docs_only" = "0" ]; then
black .

python setup.py build

python setup.py sdist
Expand All @@ -33,7 +35,7 @@ if [ "$docs_only" = "0" ]; then
nosetests .

pylint --rcfile=setup.cfg abydos > pylint.log
pycodestyle . > pycodestyle.log
# pycodestyle . > pycodestyle.log
flake8 . > flake8.log
doc8 . > doc8.log

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = black,py36,py27,doctest,py36-regression,py27-regression,py36-fuzz,py27-fuzz,pylint,pycodestyle,flake8,doc8,badges,docs
envlist = black,py36,py27,doctest,py36-regression,py27-regression,py36-fuzz,py27-fuzz,pylint,flake8,doc8,badges,docs

[testenv]
deps =
Expand Down

0 comments on commit 2d77ac9

Please sign in to comment.