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

Add more YARD docs #1740

Merged
merged 21 commits into from
Sep 18, 2019
Merged

Add more YARD docs #1740

merged 21 commits into from
Sep 18, 2019

Conversation

connorshea
Copy link
Member

@connorshea connorshea commented Sep 11, 2019

Add YARD docs for the following fakers:

  • Faker::Device
  • Faker::Dessert
  • Faker::Appliance
  • Faker::Subscription
  • Faker::Military
  • Faker::Movie
  • Faker::Science
  • Faker::Superhero
  • Faker::Marketing
  • Faker::NatoPhoneticAlphabet
  • Faker::IndustrySegments
  • Faker::ElectricalComponents
  • Faker::GreekPhilosophers
  • Faker::Music::RockBand
  • Faker::Music::GratefulDead
  • Faker::Music::Phish
  • Faker::Games::Witcher
  • Faker::Games::Dota
  • Faker::Games::LeagueOfLegends
  • Faker::Games::Heroes
  • Faker::Games::HeroesOfTheStorm
  • Faker::Games::Myst
  • Faker::Games::WorldOfWarcraft
  • Faker::Games::Pokemon
  • Faker::Games::SonicTheHedgehog
  • Faker::JapaneseMedia::DragonBall
  • Faker::JapaneseMedia::SwordArtOnline
  • Faker::Movies::TheHobbit

This completes adding YARD docs for all the Faker::Games classes :D

This brings YARD doc coverage up from 18.57% to 27.02% :)

# before
Files:         174
Modules:         3 (    2 undocumented)
Classes:       181 (  177 undocumented)
Constants:      37 (   36 undocumented)
Attributes:      8 (    0 undocumented)
Methods:       848 (  662 undocumented)
 18.57% documented

# after
Files:         174
Modules:         3 (    2 undocumented)
Classes:       181 (  177 undocumented)
Constants:      37 (   36 undocumented)
Attributes:      8 (    0 undocumented)
Methods:       848 (  571 undocumented)
 27.02% documented

@connorshea connorshea changed the title Add more yard docs Add more YARD docs Sep 11, 2019
@vbrazo vbrazo requested a review from Zeragamba September 11, 2019 05:17
@connorshea
Copy link
Member Author

One interesting thing I've noticed is that YARD seems to pick up String as Faker::String when it's used as a type.

So when you have something like this:

# Returns 'foo'.
#
# @return [String]
def method_name
   'foo'
end

It assumes String refers to Faker::String. I'm not sure how to fix that :/ Replacing every usage of String with ::String in the YARD docs is pretty easy, but also quite ugly and a bit hard to understand.

@connorshea
Copy link
Member Author

Also, in case anyone is curious, my main goal for adding all these YARD docs is to enable automatically generating types and documentation for Faker using Sord, so I can have it with Sorbet in my editor :)

Screen Shot 2019-09-10 at 11 35 24 PM

@Zeragamba
Copy link
Contributor

I saw that issue with Faker::String while I was experimenting. No real fix for it unfortunately.

On a side note, I noticed that the doc coverage badge in the readme points to the wrong repo. Can you add a quick fix for that?

@connorshea
Copy link
Member Author

@Zeragamba fixed.

@Zeragamba
Copy link
Contributor

Looks good to me. Thanks!

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@vbrazo vbrazo merged commit af00ffd into faker-ruby:master Sep 18, 2019
@connorshea connorshea deleted the add-more-yard-docs branch September 19, 2019 01:50
@connorshea connorshea mentioned this pull request Sep 21, 2019
# @example
# Faker::Appliance.equipment #=> "Appliance plug"
#
# @faker.version 1.9.0
def equipment
fetch('appliance.equipment')
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

END

michebble pushed a commit to michebble/faker that referenced this pull request Feb 16, 2020
* Add YARD docs for a few games.

- Pokemon
- Sonic the Hedgehog
- Heroes of the Storm

* Add more YARD docs for games and anime.

- Heroes 3
- Dragon Ball
- Myst
- World of Warcraft

* Add YARD docs for some miscellaneous classes.

- IndustrySegments
- ElectricalComponents
- GreekPhilosophers

* Add YARD docs for Device and Dessert fakers.

* Add YARD doc for Faker::RockBand

* Fix typo in DragonBall YARD doc.

* Add YARD docs for Dota and League of Legends.

* Add YARD docs for The Witcher.

* Add YARD docs for Faker::Military

* Add YARD docs for Faker::Appliance.

* Add YARD docs for Faker::Subscription.

* Add YARD docs for SAO.

* Add YARD docs for The Hobbit.

* Add a YARD doc for Faker::Movie

* Add YARD docs for Faker::Science.

* Add YARD docs for Faker::Marketing.

* Add YARD docs for Faker::Superhero.

* Add YARD doc for Faker::NatoPhoneticAlphabet.

* Add YARD docs for GratefulDead and Phish.

* Update Inch CI badge in README.

* Change Inch CI link to HTTPS.
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Add YARD docs for a few games.

- Pokemon
- Sonic the Hedgehog
- Heroes of the Storm

* Add more YARD docs for games and anime.

- Heroes 3
- Dragon Ball
- Myst
- World of Warcraft

* Add YARD docs for some miscellaneous classes.

- IndustrySegments
- ElectricalComponents
- GreekPhilosophers

* Add YARD docs for Device and Dessert fakers.

* Add YARD doc for Faker::RockBand

* Fix typo in DragonBall YARD doc.

* Add YARD docs for Dota and League of Legends.

* Add YARD docs for The Witcher.

* Add YARD docs for Faker::Military

* Add YARD docs for Faker::Appliance.

* Add YARD docs for Faker::Subscription.

* Add YARD docs for SAO.

* Add YARD docs for The Hobbit.

* Add a YARD doc for Faker::Movie

* Add YARD docs for Faker::Science.

* Add YARD docs for Faker::Marketing.

* Add YARD docs for Faker::Superhero.

* Add YARD doc for Faker::NatoPhoneticAlphabet.

* Add YARD docs for GratefulDead and Phish.

* Update Inch CI badge in README.

* Change Inch CI link to HTTPS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants