diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..1b4077e --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,34 @@ +name: Build and test + +on: [push] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Lint with pylint + run: | + pylint $(git ls-files '*.py') + - name: Test with pytest + run: | + pytest \ No newline at end of file diff --git a/README.md b/README.md index fde50bc..7cceb60 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Usage examples The following examples assume a `credentials.json` file in the project directory. -1. To analyze the messages of your inbox with resepect to their sender +1. To analyze the messages of your inbox with respect to their sender domains and to see the envisaged label structure (without actually creating labels), call @@ -98,7 +98,7 @@ directory. inbox contains multiple messages from the domain `foobar` and a label called `test/foobar` is existing, it will be displayed as matching target label. Only the lowest hierarchy level will be used - for name comparision, i.e., a label called `foobar/test` will not be + for name comparison, i.e., a label called `foobar/test` will not be displayed as match. If the messages from each domain shall be sorted under their diff --git a/gmailsort_test.py b/gmailsort_test.py new file mode 100644 index 0000000..c39f14f --- /dev/null +++ b/gmailsort_test.py @@ -0,0 +1,4 @@ +# TODO add real tests +def test_first_dummy_test(): + my_variable = "abc" + assert "abc" == my_variable \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index b7b4407..e38f17f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,7 @@ google-auth-oauthlib tldextract progress ftfy -argcomplete \ No newline at end of file +argcomplete +flake8 +pytest +pylint \ No newline at end of file