You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add a new attribute to the Resource class when using VirtualCodebase, I expect my new attribute to show up at the end of all the other attributes that already exist from the attributes collected from the input scan file. What happens when I export the codebase to JSON is that the new attribute shows up in front or in the middle of all the other attributes.
It turns out that the attributes classes created by attrs have a counter attribute that dictates attribute order. I worked around this issue by doing this:
I think this may have been fixed now. This was because of the combo of an attrs bugs and a workaround ... we need to retest that since python-attrs/attrs#339 has been fixed and merged python-attrs/attrs#343
@JonoYang Can you retest this with the latest code?
I added a new attribute to the Resource class when using VirtualCodebase like so:
When I add a new attribute to the Resource class when using VirtualCodebase, I expect my new attribute to show up at the end of all the other attributes that already exist from the attributes collected from the input scan file. What happens when I export the codebase to JSON is that the new attribute shows up in front or in the middle of all the other attributes.
It turns out that the attributes classes created by
attrs
have acounter
attribute that dictates attribute order. I worked around this issue by doing this:Now, the new
matches
attribute is at the end of all the other attributes, as desired.It would be nice to have a way to not have to do this workaround when adding new attributes to Resources in a VirtualCodebase.
The text was updated successfully, but these errors were encountered: