Keep inline annotations over docstring generated ones#61
Merged
lagru merged 8 commits intoscientific-python:mainfrom Jul 17, 2025
Merged
Keep inline annotations over docstring generated ones#61lagru merged 8 commits intoscientific-python:mainfrom
lagru merged 8 commits intoscientific-python:mainfrom
Conversation
Keeping parameters is already tested in `override_docstring_param` above – no need to do so again.
The `underline` method of the `ErrorReporter` includes the underlined line already.
Also makes sure that imports of a doctype are not unnecessarily included an inline annotation already exists.
even if a different docstring annotation exists. This is the same behavior as for parameters and return types.
Probably forgot to do so during debugging.
Member
|
Thanks @OriolAbril. I finally got around to reviewing this. I added a few more updates and tweaks. E.g. I also made sure that assignments / attributes behave the same as parameter and return annotations. |
lagru
approved these changes
Jul 12, 2025
Member
lagru
left a comment
There was a problem hiding this comment.
Let me know if you want to give it a look. But I think this should work for you. :)
Contributor
Author
|
Thanks! I have done some quick checks and found no issues. Also as the warnings don't fail the respective local pre-commit check I will be able to start adding it to CI without problem from 0.4 onwards 🎉 (I'll probably be back with other issues, but I can always add an inline override as a hotfix now) |
Member
|
Thanks @OriolAbril for getting this going! |
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.
I have started playing with this a bit in between meetings.
The other place with the "Replacing inline type hint" message wasn't actually being triggered,
I am not sure if it has to do with the condition not being correct or with something else,
I managed to do something similar to the return method in the param method which seems to work.
For now I have updated but kept the messages, however, I think they should not be present by default,
maybe only when requested through a verbosity flag or something.
I also noticed that there are some import related updates. Should these be modified or simply
skipped when keeping the inline type-hint?
Release note