Skip to content

Commit

Permalink
add validation of docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge committed Oct 28, 2020
1 parent d2cb49c commit 6a93f74
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 225 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ jobs:
- name: Lint Code 🎎
run: make lint

- name: Checkout target branch to be able to diff
if: github.event_name == 'pull_request'
run: |
git fetch --depth=1 origin ${{ github.base_ref }}
- name: Check Docstring conventions 📃
if: github.event_name == 'pull_request'
run: make lint-docs branch=origin/${{ github.base_ref }}

- name: Check Types 📚
run: make types

Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ help:
@echo " Apply black formatting to code."
@echo " lint"
@echo " Lint code with flake8, and check if black formatter should be applied."
@echo " lint-docs"
@echo " Check docstring conventions in changed files."
@echo " types"
@echo " Check for type errors using mypy."
@echo " prepare-tests-ubuntu"
Expand Down Expand Up @@ -59,9 +61,16 @@ formatter:
poetry run black rasa tests

lint:
poetry run flake8 rasa tests
# Ignore docstring errors when running on the entire project
poetry run flake8 rasa tests --extend-ignore D
poetry run black --check rasa tests

branch ?= master
lint-docs:
# Lint docstrings only against the the diff to avoid too many errors.
# Check only production code. Ignore other flake errors which are captured by `lint`
git diff $(branch) -- rasa | poetry run flake8 --select D --diff

types:
# FIXME: working our way towards removing these
# see https://github.com/RasaHQ/rasa/pull/6470
Expand Down
Loading

0 comments on commit 6a93f74

Please sign in to comment.