Skip to content

Commit 07a685b

Browse files
authored
Merge pull request #9 from LeanderCS/8
8 | Extend docs
2 parents 0083fcb + bd0b6df commit 07a685b

File tree

100 files changed

+939
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+939
-244
lines changed

.DS_Store

8 KB
Binary file not shown.

.coveragerc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[run]
2-
omit = __init__.py, setup.py, test_*.py
2+
source = flask_inputfilter
3+
4+
[report]
5+
omit = __init__.py, setup.py, */test/*

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
**.md
22
.gitignore
3-
.git
43
.github
54
.idea
65
.vscode

.github/workflows/test.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Run Tests
22

3-
on: [ push ]
3+
on: [push]
44

55
permissions:
66
actions: read
@@ -23,7 +23,12 @@ jobs:
2323
set -e # Exit immediately if a command exits with a non-zero status.
2424
set -u # Exit immediately if a variable is not defined.
2525
26-
docker run flask-inputfilter pytest
26+
docker run flask-inputfilter coverage run --source=flask_inputfilter -m pytest test/
27+
28+
- name: Upload coverage to Coveralls
29+
env:
30+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
31+
run: docker run -e COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} flask-inputfilter coveralls
2732

2833
- name: Run code style checks
2934
run: |

CHAGELOG.md

Lines changed: 2 additions & 2 deletions

CREATE_OWN.md

Lines changed: 1 addition & 0 deletions

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM python:3.7-slim
22

33
WORKDIR /app
44

5-
RUN apt-get update && apt-get install -y gcc python3-dev
5+
RUN apt-get update && apt-get install -y gcc python3-dev git
66

77
RUN pip install --upgrade pip
88

README.md

Lines changed: 26 additions & 6 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from typing import Any, Dict
2+
3+
from .BaseCondition import BaseCondition
4+
5+
6+
class ArrayLengthEqualCondition(BaseCondition):
7+
"""
8+
Condition that checks if the array is of the specified length.
9+
"""
10+
11+
def __init__(
12+
self, first_array_field: str, second_array_field: str
13+
) -> None:
14+
self.first_array_field = first_array_field
15+
self.second_array_field = second_array_field
16+
17+
def check(self, data: Dict[str, Any]) -> bool:
18+
return len(data.get(self.first_array_field) or []) == len(
19+
data.get(self.second_array_field) or []
20+
)

src/flask_inputfilter/Condition/ArrayLongerThanCondition.py renamed to flask_inputfilter/Condition/ArrayLongerThanCondition.py

File renamed without changes.

0 commit comments

Comments
 (0)