Add docstrings to every public mudule, class and function#446
Merged
Add docstrings to every public mudule, class and function#446
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #446 +/- ##
==========================================
- Coverage 77.47% 77.46% -0.01%
==========================================
Files 42 42
Lines 3511 3510 -1
==========================================
- Hits 2720 2719 -1
Misses 791 791
🚀 New features to boost your workflow:
|
toondaey
reviewed
Jun 11, 2025
Contributor
toondaey
left a comment
There was a problem hiding this comment.
Not a part of this but also saw some errors:
- .cognite/extractorutils/exceptions.py - "Unknown" instead of "Unkown".
- .cognite/extractorutils/metrics.py - "overriden" instead of "overrided".
- ./cognite/extractorutils/unstable/configuration/exceptions.py - "Unknown" instead of "Unkown".
Not sure if we can change this but also a spelling error:
./cognite/extractorutils/uploader/time_series.py - "Sequence" instead of "Sequnce"
toondaey
reviewed
Jun 11, 2025
Co-authored-by: Babatunde Aromire <babatunde.aromire@cognite.com>
Contributor
thorkildcognite
left a comment
There was a problem hiding this comment.
Minor nits to consider
Contributor
|
risk review ok -- some small nits pointed out that you might fix, but nothing big. |
toondaey
approved these changes
Jun 12, 2025
Contributor
|
risk review ok |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables the
Drule for ruff, which requires docstrings on every public module, class and function. It also contains some validation of the docstrings themeselves (such as ensuring that every function parameter is covered, and making sure the docstring adheres to the style guide.I also intend on adding the
DOCrule which adds further validation of the doc strings (such as looking for exceptions being thrown that aren't documented), but that also requires us to run inpreviewmode which will trigger more linting fixes, so I'll do that in a later PR.I've also completely turned off the
Drule for tests for now. While I think some simple documentation would be good for the tests, I'm trying to keep this PR small (believe it or not...).This is a massive PR in terms of line changes, but it's only adding or fixing documentation strings, no functional changes are made.