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 Validation Hooks For Docstrings (Numpydocs) And Spelling (Typos) #106

Merged
merged 8 commits into from
May 8, 2024

Conversation

AFg6K7h4fhy2
Copy link
Collaborator

Add the pre-commit hooks for numpydocs (validation numpy style docstrings) and typos (finding spelling errors). As part of this, 2 config files were added: _typos.toml and a section in ./model/pyproject.toml for numpydocs. To have numpydocs work successfully, there were small edits made across many files.

The final _typos.toml:

[default]
extend-ignore-identifiers-re = [
    "AttributeID.*Supress.*",
]

[default.extend-identifiers]
AttributeIDSupressMenu = "AttributeIDSupressMenu"

[default.extend-words]
# words that should not be corrected
damon = "Damon"

The final numpydocs checks:

[tool.numpydoc_validation]
checks = [
    "GL03",
    "GL08",
    "SS01",
    "PR03",
    "PR04",
    "PR07",
    "RT01"
]
exclude = [  # don't report on objects that match any of these regex
    '\.undocumented_method$',
    '\.__repr__$',
    '\.__call__$'
]

@AFg6K7h4fhy2 AFg6K7h4fhy2 added documentation Improvements or additions to documentation request New feature or request labels May 7, 2024
@AFg6K7h4fhy2 AFg6K7h4fhy2 requested a review from gvegayon May 7, 2024 20:13
@AFg6K7h4fhy2 AFg6K7h4fhy2 self-assigned this May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.01%. Comparing base (524f708) to head (33770ca).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   91.48%   92.01%   +0.53%     
==========================================
  Files          33       34       +1     
  Lines         634      664      +30     
==========================================
+ Hits          580      611      +31     
+ Misses         54       53       -1     
Flag Coverage Δ
unittests 92.01% <100.00%> (+0.53%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

model/pyproject.toml Outdated Show resolved Hide resolved
Copy link
Member

@gvegayon gvegayon left a comment

Choose a reason for hiding this comment

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

Looks great! A few minor changes. Thanks for the heavy lift, @AFg6K7h4fhy2!

Co-authored-by: George G. Vega Yon <g.vegayon@gmail.com>
@gvegayon
Copy link
Member

gvegayon commented May 8, 2024

I just fixed a handful of things, @AFg6K7h4fhy2. We are good to go once checks pass.

@gvegayon
Copy link
Member

gvegayon commented May 8, 2024

The error in pre-commit should be fixed once the PR is merged. It is related to files that are not present in the PR but are on main.

@gvegayon gvegayon merged commit c6265f5 into main May 8, 2024
7 of 8 checks passed
@gvegayon gvegayon deleted the upx3-ndocs-typos branch May 8, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants