Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docstr-coverage workflow #1409

Merged
merged 4 commits into from
Jan 27, 2021
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
27 changes: 27 additions & 0 deletions .docstr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
paths:
- tardis
#badge: docs
#exclude: .*/test # regex
verbose: 2 # int (0-3)
skip_magic: True
skip_file_doc: True
skip_init: True
skip_class_def: False
skip_private: True
follow_links: True
#ignore_names_file: .*/test # regex
#fail_under: 90
percentage_only: False
#ignore_patterns: # Dict with key/value pairs of file-pattern/node-pattern
# .*: method_to_ignore_in_all_files
# FileWhereWeWantToIgnoreAllSpecialMethods: "__.+__"
# SomeFile:
# - method_to_ignore1
# - method_to_ignore2
# - method_to_ignore3
# a_very_important_view_file:
# - "^get$"
# - "^set$"
# - "^post$"
# detect_.*:
# - "get_val.*"
37 changes: 37 additions & 0 deletions .github/workflows/docstr-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: docstr-coverage

on:
pull_request:
branches:
- master

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install docstr-coverage
run: pip install docstr-coverage

- name: Get base coverage
run: |
git checkout ${{ github.event.pull_request.base.sha }}
echo "BASE_COV=$(docstr-coverage -p)" >> $GITHUB_ENV

- name: Get head coverage
run: |
git checkout ${{ github.event.pull_request.head.sha }}
docstr-coverage --fail-under=$BASE_COV

- name: Blame
if: ${{ failure() }}
run: |
git diff --name-only $(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) | xargs docstr-coverage --accept-empty