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