Closed Lucretius closed 3 years ago
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities (and 0 Security Hotspots to review)
0 Code Smells
No Coverage information
2.4% Duplication
First Thank you for your contribution.
We cannot change the default from the ones that exist today and the current way that name precedence works the way that you put here is I modify the name the result will not be always the one expected. change this would require that the whole compose name function would be completely rewritten. to do not mix the order into wich the names are created and the order into which you remove things if they do not fit.
This PR is to allow someone who is consuming the component to specify the order of the three sections of the name (not including prefix/suffix, which, by their name should always be at the beginning or end). Our use case is that we potentially wanted the ability to put the slug at the end precedence of
["name","random","slug"]
withsuffixes = []
. The restrictions I've placed on thename_precedence
require it to be a list of three unique strings, where each string must be one ofname
,random
orslug
.This included changing a line in the
composeName
function but will result in no change to any current functionality as I did not find any cases of theinitialized
function arg being set.All unit tests passed, and I have added a new one to test the name order swap.