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

feat: use pydoclint as a documentation linter #212

Merged
merged 15 commits into from
Oct 31, 2023
Merged

Conversation

ireneisdoomed
Copy link
Contributor

@ireneisdoomed ireneisdoomed commented Oct 31, 2023

Checks between a function's arguments and types and its docstrings were lost in the transition to Ruff.
It is in Ruff's plans to bring this functionality (issue), but they haven't started yet.
For the time being I propose using pydoclint, a high performance alternative to darglint (the tool that flake8 relied on).

This PR contains:

  • addition and configuration of pydoclint to the project
  • addition of docstring linting to the make check rule
  • addition to pydoclint as one of the pre commit hooks
  • several fixes of all issues raised in pydoclint in our project
  • a change in tests/airflow/test_dag.py to comment out a failing test test_no_import_errors
    • this is raised due to an environment discrepancy between the test (which reads the module relative to the rest of the project) and airflow (which resolves the DAG independently of the project)

@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2023

Codecov Report

Merging #212 (c2ffd01) into main (8525981) will increase coverage by 0.01%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #212      +/-   ##
==========================================
+ Coverage   89.55%   89.57%   +0.01%     
==========================================
  Files          69       69              
  Lines        1446     1448       +2     
==========================================
+ Hits         1295     1297       +2     
  Misses        151      151              
Files Coverage Δ
src/conftest.py 100.00% <100.00%> (ø)
src/otg/common/Liftover.py 80.64% <100.00%> (ø)
src/otg/common/schemas.py 100.00% <ø> (ø)
src/otg/common/session.py 69.44% <100.00%> (ø)
src/otg/common/spark_helpers.py 100.00% <ø> (ø)
src/otg/common/utils.py 82.14% <100.00%> (ø)
src/otg/dataset/colocalisation.py 100.00% <ø> (ø)
src/otg/dataset/dataset.py 82.69% <100.00%> (ø)
src/otg/dataset/gene_index.py 100.00% <ø> (ø)
src/otg/dataset/intervals.py 64.28% <ø> (ø)
... and 23 more

@ireneisdoomed ireneisdoomed marked this pull request as ready for review October 31, 2023 13:18
Copy link
Collaborator

@d0choa d0choa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

@ireneisdoomed ireneisdoomed merged commit 6b2fc53 into main Oct 31, 2023
2 checks passed
@ireneisdoomed ireneisdoomed deleted the il-docstring-linter branch October 31, 2023 14:25
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.

3 participants