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

Exclude string.rb from consideration by YARD. #1853

Merged

Conversation

connorshea
Copy link
Member

@connorshea connorshea commented Dec 5, 2019

This is a bit of a dumb hack. Without this, YARD will assume all references to "String" (so pretty much every return type in the entire codebase) mean Faker::String, which is incorrect, and also messes up the auto-generated Sorbet types and the VS Code IntelliSense provided by solargraph.

The long-term solution for this is probably to deprecate Faker::String and move the Faker::String.random method into Faker::Types.

The downside to this solution is that the Faker::String class is excluded from the YARD docs, but unfortunately I can't think of a better option (I generally consider replacing every instance of String in the YARD docs with ::String to not be a reasonable solution).

@vbrazo @Zeragamba thoughts?

This is necessary because otherwise YARD will assume all
references to "String" mean Faker::String.

The long-term solution for this is probably to deprecate Faker::String
and move the Faker::String.random method into Faker::Types.
@Zeragamba
Copy link
Contributor

I think it's a good workaround in the meantime as well.

@Zeragamba Zeragamba requested a review from vbrazo May 18, 2020 17:39
@Zeragamba Zeragamba merged commit a09c5d4 into faker-ruby:master Jun 10, 2020
@Zeragamba
Copy link
Contributor

merged :)

@vbrazo vbrazo added the Chores label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants