faker
faker copied to clipboard
Some generators have inconsistent names
Describe the bug
The following generator classes use naming conventions that are inconsistent with the rest of the generators and with the relationship between other generators and their file names:
"What the name would be if consistent with the rest of the generators" => "What the name actually is"
{
"FullmetalAlchemist" => "Fma",
"Dnd" => "DnD",
"Music::Show" => "Show", # All other other intermediate namespace classes contract to the excluded orphan with a pluralisation where the namespace class starts with the orphan, eg "Book" and "Books". In this case the orphan class appears to be "Musicals" not "Shows", which would modify the relationship but retain consistency (from namespace starts with orphan to either starts with the other).
"Nhs" => "NationalHealthService",
"IdNum" => "IDNum", # I couldn't find an inflector to handle this kind of ID case.
"InternetHttp" => "Internet::HTTP", # This is an exception both for its namespace (Internet, which is all in the default namespace) and its directory location (Default, where other generator classes are not further namespaced)
"TheItCrowd" => "TheITCrowd",
"::Room" => "::TheRoom"
}
Additionally, Locations
appears to be a real namespace looking at the directory structure, but isn't one, housing a single generator class (Australia) and contracting as though it was in the default directory. The default directory acting as an extension of the top level namespace seems perfectly reasonable though.
Expected behavior
Generators should use consistent naming and namespace rules to avoid needing arbitrary filtering rules for their randomised or programmatic invocation.
A bit of an update on this: we had some sessions around this during ruby conf as you can see there were four PRs that came out of this but we did agree on leaving some of the inconsistent names in place because they do follow proper/popular capitalization.
Fixed on in progress are.
- The room being changed/deprecated to the Room
- Show being changed/deprecated to theater instead as that made it's function more clear.
- fmabrotherhood being changed FullmetalAlchemist from fmabrotherhood to the fullname.
- IDNumber is being changed to IdNumber.
However, we did decide to leave DnD and TheITcrowd as they are because DnD is the popular spelling of the game and TheITCrowd follows correct capitilization.
I think that caught the gist of everything unless @stefannibrasil and @thdaraujo have more to add.
P.S Any of the generators that I haven't mentioned but are in the issue are still up for grabs.
Thanks @sjjbirch for creating the issue, some of these generators have inconsistent names. And thanks @Jamal-A-Mohamed for summarizing the work that is being done to address this issue.
Thanks everyone! So the remaining generators are:
- "Nhs" => "NationalHealthService"
- "Faker::Australia" => place it inside of the
Locations
module to follow the directory structure.