Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some generators have inconsistent names #2787

Closed
sjjbirch opened this issue Jun 26, 2023 · 3 comments · Fixed by #2923
Closed

Some generators have inconsistent names #2787

sjjbirch opened this issue Jun 26, 2023 · 3 comments · Fixed by #2923

Comments

@sjjbirch
Copy link

sjjbirch commented Jun 26, 2023

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.

@sjjbirch sjjbirch changed the title Issue title goes here Some generators have inconsistent names Jun 27, 2023
kirkkwang added a commit to kirkkwang/faker that referenced this issue Nov 13, 2023
This commit will rename instances of room to the_room including the
locales.  Originally the `room.md` had a typo that referenced ::Room and
not ::TheRoom which is also fixed here.

Ref:
  - faker-ruby#2787

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
stefannibrasil pushed a commit that referenced this issue Nov 13, 2023
This commit will rename instances of room to the_room including the
locales.  Originally the `room.md` had a typo that referenced ::Room and
not ::TheRoom which is also fixed here.

Ref:
  - #2787

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
@Jamal-A-Mohamed
Copy link
Contributor

Jamal-A-Mohamed commented Nov 14, 2023

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.

@thdaraujo
Copy link
Contributor

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.

@stefannibrasil
Copy link
Contributor

Thanks everyone! So the remaining generators are:

  • "Nhs" => "NationalHealthService"
  • "Faker::Australia" => place it inside of the Locations module to follow the directory structure.

stefannibrasil pushed a commit that referenced this issue Feb 26, 2024
* Favor 'The Room' instead of 'Room'

This commit will rename instances of room to the_room including the
locales.  Originally the `room.md` had a typo that referenced ::Room and
not ::TheRoom which is also fixed here.

Ref:
  - #2787

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>

* Fix/Deprecate FmaBrotherhood Generator

This commit fixes the naming discrpencies with the FmaBrotherhood (now
FullmetalAlchemistBrotherhood) class and its filename.  This adds
deprecation warnings for the old FmaBrotherhood class and also makes the
new FullmetalAlchemistBrotherhood class.

Fix:
  - #2853

* Refactor deprecation for `FmaBrotherhood`

This commit will refactor the changes from `FmaBrotherhood` to
`FullmetalAlchemistBrotherhood` and use `Faker::Deprecator`.

---------

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>
keshavbiswa pushed a commit to keshavbiswa/faker that referenced this issue Mar 17, 2024
* Favor 'The Room' instead of 'Room'

This commit will rename instances of room to the_room including the
locales.  Originally the `room.md` had a typo that referenced ::Room and
not ::TheRoom which is also fixed here.

Ref:
  - faker-ruby#2787

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>

* Fix/Deprecate FmaBrotherhood Generator

This commit fixes the naming discrpencies with the FmaBrotherhood (now
FullmetalAlchemistBrotherhood) class and its filename.  This adds
deprecation warnings for the old FmaBrotherhood class and also makes the
new FullmetalAlchemistBrotherhood class.

Fix:
  - faker-ruby#2853

* Refactor deprecation for `FmaBrotherhood`

This commit will refactor the changes from `FmaBrotherhood` to
`FullmetalAlchemistBrotherhood` and use `Faker::Deprecator`.

---------

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>
stefannibrasil pushed a commit that referenced this issue Mar 19, 2024
* update Faker::Australia to Faker::Locations::Australia

* Bump minitest from 5.21.1 to 5.21.2 (#2894)

Bumps [minitest](https://github.com/minitest/minitest) from 5.21.1 to 5.21.2.
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](minitest/minitest@v5.21.1...v5.21.2)

---
updated-dependencies:
- dependency-name: minitest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump rubocop from 1.59.0 to 1.60.2 (#2896)

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.59.0 to 1.60.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.59.0...v1.60.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add Kenya to supported countries (#2871)

* Add Kenya to supported countries

* Add tests for locale

* clan up pull request

* Add landline telephone numbers and cell phone formats

* Bump minitest from 5.21.2 to 5.22.2 (#2902)

Bumps [minitest](https://github.com/minitest/minitest) from 5.21.2 to 5.22.2.
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](minitest/minitest@v5.21.2...v5.22.2)

---
updated-dependencies:
- dependency-name: minitest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump test-unit from 3.6.1 to 3.6.2 (#2906)

Bumps [test-unit](https://github.com/test-unit/test-unit) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/test-unit/test-unit/releases)
- [Commits](test-unit/test-unit@3.6.1...3.6.2)

---
updated-dependencies:
- dependency-name: test-unit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Refactor `Faker::IDNumber` to `Faker::IdNumber` to be more consistent with other generator's naming convention. (#2858)

* Deprecate IDNumber to IdNumber per issue#2787

* wip

* Add a Faker::Deprecator module

Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>

* Add more specs and improve warning message

---------

Co-authored-by: jamal.mohamed <jamal.mohamed@covermymeds.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>
Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>

* Fix/Deprecate FmaBrotherhood Generator (#2856)

* Favor 'The Room' instead of 'Room'

This commit will rename instances of room to the_room including the
locales.  Originally the `room.md` had a typo that referenced ::Room and
not ::TheRoom which is also fixed here.

Ref:
  - #2787

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>

* Fix/Deprecate FmaBrotherhood Generator

This commit fixes the naming discrpencies with the FmaBrotherhood (now
FullmetalAlchemistBrotherhood) class and its filename.  This adds
deprecation warnings for the old FmaBrotherhood class and also makes the
new FullmetalAlchemistBrotherhood class.

Fix:
  - #2853

* Refactor deprecation for `FmaBrotherhood`

This commit will refactor the changes from `FmaBrotherhood` to
`FullmetalAlchemistBrotherhood` and use `Faker::Deprecator`.

---------

Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>

* Bump i18n from 1.14.1 to 1.14.4 (#2913)

Bumps [i18n](https://github.com/ruby-i18n/i18n) from 1.14.1 to 1.14.4.
- [Release notes](https://github.com/ruby-i18n/i18n/releases)
- [Changelog](https://github.com/ruby-i18n/i18n/blob/master/CHANGELOG.md)
- [Commits](ruby-i18n/i18n@v1.14.1...v1.14.4)

---
updated-dependencies:
- dependency-name: i18n
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove duplicates in doc file (#2914)

* Bump rubocop from 1.60.2 to 1.62.1 (#2916)

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.60.2 to 1.62.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v1.60.2...v1.62.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump yard from 0.9.34 to 0.9.36 (#2909)

Bumps [yard](https://github.com/lsegal/yard) from 0.9.34 to 0.9.36.
- [Release notes](https://github.com/lsegal/yard/releases)
- [Changelog](https://github.com/lsegal/yard/blob/main/CHANGELOG.md)
- [Commits](lsegal/yard@v0.9.34...v0.9.36)

---
updated-dependencies:
- dependency-name: yard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Deprecated Faker::Australia

* Added Docs for Australia

* Updated Readme to include Locations

* Updated locales path for australia

* updated test to differentiate deprecated methods

* Removed whitespaces from australia.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nduati <nduatiandrew@gmail.com>
Co-authored-by: Jamal-A-Mohamed <37128483+Jamal-A-Mohamed@users.noreply.github.com>
Co-authored-by: jamal.mohamed <jamal.mohamed@covermymeds.com>
Co-authored-by: Stefanni Brasil <stefannibrasil@gmail.com>
Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>
Co-authored-by: Kirk Wang <kirk.wang@scientist.com>
Co-authored-by: Jamal-A-Mohamed <jamalashur@gmail.com>
Co-authored-by: Salvador <salvador.tena@scientist.com>
Co-authored-by: Michael Marusyk <31774981+mmarusyk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants