Added isort config; linter now checks tests
continuous-integration/drone the build failed
Details
continuous-integration/drone the build failed
Details
parent
cffc928d2f
commit
e044c07cd6
8
Makefile
8
Makefile
|
@ -4,6 +4,7 @@ PYTHON := python3
|
||||||
VENV := .venv
|
VENV := .venv
|
||||||
# Minimum % coverage for tests to succeed
|
# Minimum % coverage for tests to succeed
|
||||||
MIN_COV := 50
|
MIN_COV := 50
|
||||||
|
SRC := setup.py app tests
|
||||||
|
|
||||||
|
|
||||||
# =====GENERAL=====
|
# =====GENERAL=====
|
||||||
|
@ -33,13 +34,14 @@ venv: $(VENV)/bin/activate
|
||||||
## Formatting & linting
|
## Formatting & linting
|
||||||
### Format the codebase using black
|
### Format the codebase using black
|
||||||
format: venv
|
format: venv
|
||||||
@ '$(VENV)'/bin/black setup.py app
|
@ '$(VENV)'/bin/black $(SRC)
|
||||||
|
@ '$(VENV)'/bin/isort $(SRC)
|
||||||
.PHONY: format
|
.PHONY: format
|
||||||
|
|
||||||
### Lint using black & flake8
|
### Lint using black & flake8
|
||||||
lint: venv
|
lint: venv
|
||||||
@ '$(VENV)'/bin/flake8 setup.py app
|
@ '$(VENV)'/bin/flake8 $(SRC)
|
||||||
@ '$(VENV)'/bin/black --check setup.py app
|
@ '$(VENV)'/bin/black --check $(SRC)
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
"""Main module for the app."""
|
|
@ -1,5 +1,5 @@
|
||||||
"""Common exceptions raised by the program."""
|
"""Common exceptions raised by the program."""
|
||||||
from typing import Union, List
|
from typing import List, Union
|
||||||
|
|
||||||
|
|
||||||
class InvalidKeyError(Exception):
|
class InvalidKeyError(Exception):
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
"""Handles merging with the skeleton config."""
|
"""Handles merging with the skeleton config."""
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
from .exceptions import InvalidKeyError, MissingKeyError
|
from .exceptions import InvalidKeyError, MissingKeyError
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,3 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 79
|
line-length = 79
|
||||||
|
|
||||||
|
[tool.isort]
|
||||||
|
profile = "black"
|
||||||
|
multi_line_output = 3
|
||||||
|
|
|
@ -22,6 +22,7 @@ lint =
|
||||||
flake8-docstrings==1.6.0
|
flake8-docstrings==1.6.0
|
||||||
flake8-print==4.0.0
|
flake8-print==4.0.0
|
||||||
flake8-quotes==3.2.0
|
flake8-quotes==3.2.0
|
||||||
|
isort==5.8.0
|
||||||
|
|
||||||
# Required for the developer
|
# Required for the developer
|
||||||
develop =
|
develop =
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -1,4 +1,4 @@
|
||||||
|
"""Setup script for the package."""
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
|
|
||||||
setuptools.setup()
|
setuptools.setup()
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
"""Main testing module."""
|
|
@ -1,15 +1,13 @@
|
||||||
"""Tests wether the skeleton merge works."""
|
"""Tests wether the skeleton merge works."""
|
||||||
from app.skeleton import merge_with_skeleton
|
|
||||||
from app.exceptions import InvalidKeyError, MissingKeyError
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from app.exceptions import InvalidKeyError, MissingKeyError
|
||||||
|
from app.skeleton import merge_with_skeleton
|
||||||
|
|
||||||
|
|
||||||
def test_single_invalid_key():
|
def test_single_invalid_key():
|
||||||
"""Tests wether an InvalidKeyError is correctly thrown for a single key."""
|
"""Tests wether an InvalidKeyError is correctly thrown for a single key."""
|
||||||
data = {
|
data = {"test": 1, "test2": "test"}
|
||||||
"test": 1,
|
|
||||||
"test2": "test"
|
|
||||||
}
|
|
||||||
skel = {
|
skel = {
|
||||||
"test": None,
|
"test": None,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue