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 flake8-docstrings to CI #748

Closed
wants to merge 21 commits into from

Conversation

mauicv
Copy link
Collaborator

@mauicv mauicv commented Feb 27, 2023

What is this?

See this note!

This PR adds flake-docstrings to lint docstrings. Originally I was setting the convention option to NumPy however flake-docstrings excludes D417-Missing argument descriptions in the docstring for NumPy. Instead, we disable the codes manually.

I've also fixed some faulty docstring formatting, specifically in the return statements for the detectors. Fixes #759

Notes

  1. Flake disables certain checks by default. Specifically: E121, E123, E126, E226, E24, E704, W503, W504 I've kept these defaults with the exception of E226 missing whitespace around arithmetic operator.
  2. Flake8-docstrings consider the following list of rules exceptions to the NumPy convection. D203, D212, D213, D402, D413, D415, D416. I've manually disabled these in order to enable D107 and D417. D107 enforces __init__'s to have docstrings and D417 enforces all parameters to be listed in docstring.
  3. The following are temporarily disabled. Will be re-enabled in a future PR: D1, D401, D205, D400. These have been added to ignores because implementing them here would be a very big job. I suggest we find some way of doing this iteratively!
  4. Ignore D403 due to this issue
  5. Ignore D208 due to conflicts with returns statement formatting.

@mauicv mauicv added the WIP PR is a Work in Progress label Feb 27, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2023

Codecov Report

Merging #748 (20cf72f) into master (5a38fc2) will decrease coverage by 0.57%.
The diff coverage is 90.81%.

❗ Current head 20cf72f differs from pull request most recent head 149f08b. Consider uploading reports for the commit 149f08b to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #748      +/-   ##
==========================================
- Coverage   81.38%   80.81%   -0.57%     
==========================================
  Files         154      144      -10     
  Lines       10007     9619     -388     
==========================================
- Hits         8144     7774     -370     
+ Misses       1863     1845      -18     
Flag Coverage Δ
macos-latest-3.9 77.42% <88.77%> (?)
ubuntu-latest-3.10 80.72% <90.81%> (?)
ubuntu-latest-3.7 80.62% <90.81%> (?)
ubuntu-latest-3.9 80.67% <90.81%> (?)
windows-latest-3.9 77.42% <88.77%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
alibi_detect/ad/adversarialae.py 62.72% <ø> (-0.67%) ⬇️
alibi_detect/ad/model_distillation.py 91.52% <ø> (-0.28%) ⬇️
alibi_detect/base.py 85.45% <ø> (ø)
alibi_detect/cd/_domain_clf.py 88.23% <ø> (ø)
alibi_detect/cd/base.py 90.97% <ø> (-0.22%) ⬇️
alibi_detect/cd/base_online.py 88.23% <ø> (ø)
alibi_detect/cd/chisquare.py 97.14% <ø> (ø)
alibi_detect/cd/classifier.py 100.00% <ø> (ø)
alibi_detect/cd/context_aware.py 97.43% <ø> (ø)
alibi_detect/cd/learned_kernel.py 100.00% <ø> (ø)
... and 76 more

... and 16 files with indirect coverage changes

@mauicv mauicv mentioned this pull request Feb 28, 2023
@mauicv mauicv mentioned this pull request Mar 6, 2023
@mauicv mauicv changed the title Add pylint and flake8-docstrings Add flake8-docstrings to CI Mar 6, 2023
@mauicv mauicv removed the WIP PR is a Work in Progress label Mar 6, 2023
@mauicv mauicv mentioned this pull request May 15, 2023
2 tasks
@mauicv mauicv closed this May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Returns sections of some docstrings
2 participants