Add CI
Added static linting, type checking for each commit as well as pytest testing for each master push. Add linting and static analysis CI Use deprecated pipeline key for server woodpecker version Format black Install poetry environment before pyright Add pytest CI Update dependencies, Fix black Ensure tests run on master branch
This commit is contained in:
parent
c6b95a4742
commit
a4f48bb24e
8 changed files with 157 additions and 35 deletions
|
|
@ -42,7 +42,7 @@ def start(filename: Path) -> list[Annotation]:
|
|||
|
||||
|
||||
def _tag_from_colorname(colorname: str) -> str:
|
||||
color_mapping: dict[str,str] = getdict("tags", "plugins.extract")
|
||||
color_mapping: dict[str, str] = getdict("tags", "plugins.extract")
|
||||
if not color_mapping:
|
||||
return ""
|
||||
|
||||
|
|
@ -82,6 +82,7 @@ def _retrieve_annotation_content(
|
|||
# just a highlight without any text
|
||||
return (None, None)
|
||||
|
||||
|
||||
# mimics the functions in papis.config.{getlist,getint,getfloat} etc.
|
||||
def getdict(key: str, section: Optional[str] = None) -> dict[str, str]:
|
||||
"""Dict getter
|
||||
|
|
@ -97,13 +98,14 @@ def getdict(key: str, section: Optional[str] = None) -> dict[str, str]:
|
|||
rawvalue = eval(rawvalue)
|
||||
except Exception:
|
||||
raise SyntaxError(
|
||||
"The key '{}' must be a valid Python object: {}"
|
||||
.format(key, rawvalue))
|
||||
"The key '{}' must be a valid Python object: {}".format(key, rawvalue)
|
||||
)
|
||||
else:
|
||||
if not isinstance(rawvalue, dict):
|
||||
raise SyntaxError(
|
||||
"The key '{}' must be a valid Python dict. Got: {} (type {!r})"
|
||||
.format(key, rawvalue, type(rawvalue).__name__))
|
||||
"The key '{}' must be a valid Python dict. Got: {} (type {!r})".format(
|
||||
key, rawvalue, type(rawvalue).__name__
|
||||
)
|
||||
)
|
||||
|
||||
return rawvalue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue