diff --git a/.docstr.yaml b/.docstr.yaml new file mode 100644 index 00000000000..fff3de64dcd --- /dev/null +++ b/.docstr.yaml @@ -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.*" diff --git a/.github/workflows/docstr-coverage.yml b/.github/workflows/docstr-coverage.yml new file mode 100644 index 00000000000..32beb1c18f2 --- /dev/null +++ b/.github/workflows/docstr-coverage.yml @@ -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