feat: display human-readable attribute in repr()
if present
#2010
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 supersedes #1996 by reusing existing scaffolding we already have for many other objects.
As an aside this should have the added benefit of further decoupling the CLI because we actually use
_repr_attr
in the API itself which was not yet the case with_short_print_attr
and it was a bit out of place inbase.py
IMO. Now, the CLi simply reuses it.Note: @Psycojoker this replaces
name_with_namespace
in your PR withpath
because we already had it and it'd otherwise be a breaking change on the CLI. Let me know if you want to override that, otherwise we'll usewith_namespace
in the next major release which I hope we can have soon with some other features. In any case I think the least confusing option would bepath_with_namespace
because people canname
the group and project anything they like, somy-evil-group/my-evil-project
can be named to display asGitLab.org / GitLab
if using names.