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 object description cop #14

Conversation

yaorlov
Copy link
Contributor

@yaorlov yaorlov commented Jul 5, 2020

@DmitryTsepelev I've implemented the ObjectDescription cop
I've tested this cop on my project and it works fine but requires some customizations (Exclude:) in .rubocop.yml.
For example, I have directories (spec/graphql and lib/graphql) that follow the same pattern as in the config/default.yml. Also, base classes like this should be excluded:

class Types::BaseUnion < GraphQL::Schema::Union
end

Please let me know what you think

@DmitryTsepelev
Copy link
Owner

Hi @yaorlov!

I've tested this cop on my project and it works fine but requires some customizations (Exclude:) in .rubocop.yml.
For example, I have directories (spec/graphql and lib/graphql) that follow the same pattern as in the config/default.yml.

In this case you can configure Patterns in your project's .rubocop.yml to add directories to be checked along with app/graphql.

Also, base classes like this should be excluded

Agreed, let's try to use Exclude option in the .default.yml for this cop (I guess we can check for base_*.rb pattern).

Also, please add yourself to the CHANGELOG.

@yaorlov
Copy link
Contributor Author

yaorlov commented Jul 8, 2020

@DmitryTsepelev I've added Exclude for base types and also for generated graphql schema. CHANGELOG was updated too.

@DmitryTsepelev
Copy link
Owner

LGTM, thanks!

@DmitryTsepelev DmitryTsepelev merged commit 9513407 into DmitryTsepelev:master Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants