Skip to content

Commit

Permalink
Enforce docstring linting! (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
sentilesdal authored Jul 19, 2023
1 parent f0c15e6 commit af4594d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,19 @@ jobs:
- name: Run black
run: python -m black --check --diff .

- name: Run pylint
run: python -m pylint $(git ls-files '*.py')
- name: Get changed Python files
id: changed_files
run: |
echo "::set-output name=files::$(git diff --name-only origin/main...HEAD | grep '.py$')"
- name: Run Pylint on changed files
run: |
files="${{ steps.changed_files.outputs.files }}"
if [ -n "$files" ]; then
pylint --rcfile=.pylintrc $files
else
echo "No Python files have changed."
fi
- name: Check GitHub rate limit at end
uses: wakamex/rate-limit-action@master
Expand Down
22 changes: 21 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ limit-inference-results=100

# List of plugins (as comma separated values of python module names) to load,
# usually to register additional checkers.
load-plugins=
load-plugins=pylint.extensions.docparams, pylint.extensions.docstyle

# Pickle collected data for later comparisons.
persistent=yes
Expand Down Expand Up @@ -617,3 +617,23 @@ variable-naming-style=snake_case
# naming-style. If left empty, variable names will be checked with the set
# naming style.
#variable-rgx=
[tool.pylint.parameter_documentation]
# Whether to accept totally missing parameter documentation
# in the docstring of a function that has parameters.
accept-no-param-doc = false

# Whether to accept totally missing raises documentation
# in the docstring of a function that raises an exception.
accept-no-raise-doc = true

# Whether to accept totally missing return documentation in
# the docstring of a function that returns a statement.
accept-no-return-doc = false

# Whether to accept totally missing yields documentation
# in the docstring of a generator.
accept-no-yields-doc = false

# If the docstring type cannot be guessed the
# specified docstring type will be used.
default-docstring-type = numpy

0 comments on commit af4594d

Please sign in to comment.