Skip to content

Commit 9e123f3

Browse files
committed
fix: lint
1 parent 1e22fac commit 9e123f3

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
l lint:
2+
@echo "Executing lint in backend code (pre-commit)"
3+
pre-commit run --show-diff-on-failure --color=always --all-files

openhexa/sdk/pipelines/parameter/decorator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ def _validate_single(self, value: typing.Any):
138138
return None
139139

140140
pre_validated = self.type.validate(normalized_value)
141-
if self.choices is not None and not isinstance(self.choices, ChoicesFromFile) and pre_validated not in self.choices:
141+
if (
142+
self.choices is not None
143+
and not isinstance(self.choices, ChoicesFromFile)
144+
and pre_validated not in self.choices
145+
):
142146
raise ParameterValueError(f"The provided value for {self.code} is not included in the provided choices.")
143147

144148
return pre_validated

openhexa/sdk/pipelines/runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from openhexa.sdk.pipelines.exceptions import InvalidParameterError, PipelineNotFound
1717
from openhexa.sdk.pipelines.parameter import (
1818
TYPES_BY_PYTHON_TYPE,
19-
DHIS2Widget,
2019
ChoicesFromFile,
20+
DHIS2Widget,
2121
IASOWidget,
2222
Parameter,
2323
validate_parameters,

0 commit comments

Comments
 (0)