Browse Source

Added pycodestyle checks

Changed .travis.yml to download pep8 module
Added pycodestyle conformance checks to be run by nosetests
devuan-deployment
edawine Niels Thykier 3 years ago
parent
commit
ed2aef3db1
No known key found for this signature in database GPG Key ID: A65B78DBE67C7AAC
3 changed files with 15 additions and 3 deletions
  1. +2
    -2
      .gitlab-ci.yml
  2. +1
    -1
      Dockerfile
  3. +12
    -0
      tests/test_pycodestyle.py

+ 2
- 2
.gitlab-ci.yml View File

@@ -3,7 +3,7 @@ tests-stretch:
image: debian:stretch
script:
- apt-get update
- apt-get install -y python3 python3-apt python3-yaml python3-pytest git rsync libclass-accessor-perl libdpkg-perl libyaml-syck-perl
- apt-get install -y python3 python3-apt python3-yaml python3-pep8 python3-pytest git rsync libclass-accessor-perl libdpkg-perl libyaml-syck-perl
- ci/gitlab-ci-runner

tests-sid:
@@ -11,7 +11,7 @@ tests-sid:
image: debian:sid
script:
- apt-get update
- apt-get install -y python3 python3-apt python3-yaml python3-coverage python3-pytest python3-pytest-cov git rsync libclass-accessor-perl libdpkg-perl libyaml-syck-perl
- apt-get install -y python3 python3-apt python3-yaml python3-coverage python3-pep8 python3-pytest python3-pytest-cov git rsync libclass-accessor-perl libdpkg-perl libyaml-syck-perl
- ci/gitlab-ci-runner --with-coverage
artifacts:
paths:


+ 1
- 1
Dockerfile View File

@@ -1,4 +1,4 @@
FROM debian:stable
WORKDIR /britney
ADD . /britney
RUN apt-get update && apt-get install --no-install-recommends --assume-yes python3 python3-apt python3-yaml python3-coverage python3-nose rsync libclass-accessor-perl libdpkg-perl libyaml-syck-perl curl
RUN apt-get update && apt-get install --no-install-recommends --assume-yes python3 python3-apt python3-yaml python3-coverage python3-nose python3-pep8 rsync libclass-accessor-perl libdpkg-perl libyaml-syck-perl curl

+ 12
- 0
tests/test_pycodestyle.py View File

@@ -0,0 +1,12 @@
import unittest
import pep8


class TestCodeFormat(unittest.TestCase):

def test_conformance(self):
"""Test that we conform to PEP-8."""
style = pep8.StyleGuide()
result = style.check_files('.')
self.assertEqual(result.total_errors, 0,
"Found code style errors (and warnings).")

Loading…
Cancel
Save