mkdocstrings / griffe

Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.
https://mkdocstrings.github.io/griffe
ISC License
267 stars 38 forks source link

fix: reporting the attribute who lost their value #225

Closed gpuligundla closed 7 months ago

gpuligundla commented 7 months ago

This PR Address the #218 issue.

Describe the bug For example, going from:

class A:
    b: int | None = None

to

class A:
    b: int

will report

Attribute value was changed: None -> None

Now modified to

Attribute value was changed: None -> unset

gpuligundla commented 7 months ago

Thanks!

It would be better to pass "unset" to the breakage instance rather than modifying the value in the actual attribute 🙂

Changed it

gpuligundla commented 7 months ago

Thanks. I realise it needs an else clause, otherwise it would yield both breakages. Could you also add a test :) ?

ah! yeah sorry for being noob, i assumed it as return keyword