1
0
mirror of https://github.com/ubuntu/microk8s.git synced 2021-05-23 02:23:41 +03:00
* Fix linting and switch to tox

Switched linting to tox
Added codspell to tox
Fixed black and codespell identified mistakes
This commit is contained in:
Chris Sanders
2021-02-09 00:18:34 -06:00
committed by GitHub
parent 58b95631be
commit ea79c78f79
5 changed files with 8 additions and 10 deletions

View File

@@ -15,12 +15,8 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get install python3-setuptools
sudo pip3 install black codespell flake8
sudo apt-get install tox
- name: Check formatting
run: |
set -eux
black --check . microk8s-resources/actions/enable.kubeflow.sh
codespell --ignore-words-list="aks" --quiet-level=2 --skip="*.patch,*.spec"
flake8 . microk8s-resources/actions/enable.kubeflow.sh
tox -e lint

View File

@@ -94,7 +94,7 @@ class InstallTests:
assert "microk8s is running" in status
def test_get_kubeconfig(self):
"""Test retreiving the kubeconfig"""
"""Test retrieving the kubeconfig"""
config = yaml.safe_load(self.node.microk8s.config)
assert config["clusters"][0]["name"] == "microk8s-cluster"
@@ -104,7 +104,7 @@ class InstallTests:
assert ready == 1
def test_addon(self, addon, input):
"""Test enableing addon"""
"""Test enabling addon"""
addon_attr = getattr(self.node.microk8s, addon)
if input:
result = addon_attr.enable(input)

View File

@@ -14,7 +14,7 @@ class NotFound(Exception):
class RetryWrapper:
"""Generic class for retyring method calls on an object"""
"""Generic class for retrying method calls on an object"""
def __init__(self, object, exception=Exception, timeout=60):
self.object = object

View File

@@ -102,7 +102,7 @@ class Lxd(Node):
"""Copy a file to the destination on node"""
src = Path(source)
with src.open(mode='rb') as f:
with src.open(mode="rb") as f:
return self.write(dest, f.read())
def get_primary_address(self):

View File

@@ -13,11 +13,13 @@ deps =
flake8
flake8-colors
pep8-naming
codespell
-r{toxinidir}/tests/requirements.txt
[testenv:lint]
commands =
-flake8
codespell --ignore-words-list="aks" --quiet-level=2 --skip="*.patch,*.spec,.tox_env"
black --diff --check --exclude "/(\.eggs|\.git|\.tox|\.venv|\.build|dist|charmhelpers|mod)/" .
[testenv:func]