Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@ jobs:
spell-check:
uses: ./.github/workflows/spellcheck.yml

docstring-check:
uses: ./.github/workflows/docstring.yml

markdown-link-check:
uses: ./.github/workflows/markdown-link-check.yml
25 changes: 25 additions & 0 deletions .github/workflows/docstring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docstring Check

on: workflow_call

jobs:
spellcheck:
name: docstringcheck
runs-on: ubuntu-latest
env:
ZENML_DEBUG: 1
ZENML_ANALYTICS_OPT_IN: false
PYTHONIOENCODING: "utf-8"

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install Dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install interrogate darglint pydocstyle
- name: Docstring Check
run: bash scripts/docstring.sh
4 changes: 2 additions & 2 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'no'
use-quiet-mode: 'yes'
use-verbose-mode: 'no'
config-file: .github/workflows/markdown_check_config.json

continue-on-error: true
3 changes: 1 addition & 2 deletions .github/workflows/publish_docker_image.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Publish Docker image

on:
workflow_call:
on: workflow_call

jobs:
publish_to_pypi:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: Spellcheck

on:
workflow_dispatch:
inputs:
tags:
description: "Use tmate session for debugging"
required: false
type: boolean
workflow_call:
on: workflow_call

jobs:
spellcheck:
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ repos:
types: [file, python]
pass_filenames: false

- repo: local
hooks:
- id: docstringcheck
name: docstringcheck
entry: poetry run bash scripts/docstring.sh
language: system
files: ^src/zenml/
types: [file, python]
pass_filenames: false

- repo: local
hooks:
- id: pytest
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ Warning: This might take a while for both (~ 15 mins each, depending on your mac
time, please run it as it will make the
next commands error-free.

It is easy to run the following scripts via Poetry to ensure code formatting and
linting is in order:
You can now run the following scripts via Poetry to automatically format your
code and to check whether the code formatting, linting, docstrings, and
spelling is in order:

```
poetry run bash scripts/format.sh
poetry run bash scripts/lint.sh
poetry run bash scripts/check-spelling.sh
poetry run bash scripts/run-ci-checks.sh
```

If the spell checker catches errors, you will have to add the words to `.pyspelling-ignore-words`. (Note that if you wish to run the spellchecks manually on your local machine, first install `aspell` (using `brew` or `apt-get` or whatever package manager Windows uses).)
Expand Down
3 changes: 0 additions & 3 deletions scripts/docstring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
set -e
set -x

# separate env variable while incrementally completing the docstring task.
# add modules to this list as/when they are completed.
# When we're done we can remove this and just use `SRC_NO_TESTS`.
DOCSTRING_SRC=${1:-"src/zenml"}

export ZENML_DEBUG=1
Expand Down
5 changes: 0 additions & 5 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@ autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in
isort $SRC scripts --check-only
black $SRC --check

# check for docstrings
interrogate $SRC_NO_TESTS -c pyproject.toml
pydocstyle $SRC_NO_TESTS -e --count --convention=google --add-ignore=D403
darglint -v 2 $SRC_NO_TESTS

# check type annotations
mypy $SRC_NO_TESTS
7 changes: 7 additions & 0 deletions scripts/run-ci-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
set -x

scripts/lint.sh
scripts/check-spelling.sh
scripts/docstring.sh