-
Notifications
You must be signed in to change notification settings - Fork 49
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
Enable InternalAffairs cop #93
Enable InternalAffairs cop #93
Conversation
3adda3f
to
47214f6
Compare
AllCops: | ||
TargetRubyVersion: 2.5 | ||
|
||
GraphQL/ObjectDescription: | ||
Enabled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why should we disable this cop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rubocop-graphql/.rubocop_todo.yml
Lines 9 to 14 in a902c71
# Offense count: 4 | |
InternalAffairs/UndefinedConfig: | |
Exclude: | |
- 'lib/rubocop/cop/graphql/extract_input_type.rb' | |
- 'lib/rubocop/cop/graphql/extract_type.rb' | |
- 'lib/rubocop/cop/graphql/resolver_method_length.rb' |
Disabled in the above response.
InternalAffairs/UndefinedConfig
considers it a violation when an option not defined in config/default.yml is referenced as cop_config[Foo
] etc.
Therefore, we require rubocop-graphql
at
Line 3 in 47214f6
- rubocop-graphql |
Then GraphQL/ObjectDescription
will be enabled and the violation will be detected as follows
However, I don't think this is the cop that resolves the code under lib/rubocop/cop/graphql/*.
lib/rubocop/cop/graphql/argument_description.rb:21:13: C: GraphQL/ObjectDescription: Missing type description
class ArgumentDescription < Base
^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/argument_name.rb:21:13: C: GraphQL/ObjectDescription: Missing type description
class ArgumentName < Base
^^^^^^^^^^^^
lib/rubocop/cop/graphql/argument_uniqueness.rb:22:13: C: GraphQL/ObjectDescription: Missing type description
class ArgumentUniqueness < Base
^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/extract_input_type.rb:6:13: C: GraphQL/ObjectDescription: Missing type description
class ExtractInputType < Base
^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/extract_type.rb:6:13: C: GraphQL/ObjectDescription: Missing type description
class ExtractType < Base
^^^^^^^^^^^
lib/rubocop/cop/graphql/field_definitions.rb:47:13: C: GraphQL/ObjectDescription: Missing type description
class FieldDefinitions < Base # rubocop:disable Metrics/ClassLength
^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/field_description.rb:21:13: C: GraphQL/ObjectDescription: Missing type description
class FieldDescription < Base
^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/field_hash_key.rb:26:13: C: GraphQL/ObjectDescription: Missing type description
class FieldHashKey < Base
^^^^^^^^^^^^
lib/rubocop/cop/graphql/field_method.rb:26:13: C: GraphQL/ObjectDescription: Missing type description
class FieldMethod < Base
^^^^^^^^^^^
lib/rubocop/cop/graphql/field_name.rb:25:13: C: GraphQL/ObjectDescription: Missing type description
class FieldName < Base
^^^^^^^^^
lib/rubocop/cop/graphql/field_uniqueness.rb:29:13: C: GraphQL/ObjectDescription: Missing type description
class FieldUniqueness < Base
^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/legacy_dsl.rb:22:13: C: GraphQL/ObjectDescription: Missing type description
class LegacyDsl < Base
^^^^^^^^^
lib/rubocop/cop/graphql/object_description.rb:23:13: C: GraphQL/ObjectDescription: Missing type description
class ObjectDescription < Base
^^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/ordered_arguments.rb:51:13: C: GraphQL/ObjectDescription: Missing type description
class OrderedArguments < Base
^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/ordered_fields.rb:33:13: C: GraphQL/ObjectDescription: Missing type description
class OrderedFields < Base
^^^^^^^^^^^^^
lib/rubocop/cop/graphql/resolver_method_length.rb:10:13: C: GraphQL/ObjectDescription: Missing type description
class ResolverMethodLength < Base
^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/graphql/unused_argument.rb:63:13: C: GraphQL/ObjectDescription: Missing type description
class UnusedArgument < Base
^^^^^^^^^^^^^^
lib/rubocop/graphql/argument.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Argument
^^^^^^^^
lib/rubocop/graphql/argument/block.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Argument
^^^^^^^^
lib/rubocop/graphql/argument/block.rb:6:13: C: GraphQL/ObjectDescription: Missing type description
class Block
^^^^^
lib/rubocop/graphql/argument/kwargs.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Argument
^^^^^^^^
lib/rubocop/graphql/argument/kwargs.rb:6:13: C: GraphQL/ObjectDescription: Missing type description
class Kwargs
^^^^^^
lib/rubocop/graphql/class.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Class
^^^^^
lib/rubocop/graphql/field.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Field
^^^^^
lib/rubocop/graphql/field/block.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Field
^^^^^
lib/rubocop/graphql/field/block.rb:6:13: C: GraphQL/ObjectDescription: Missing type description
class Block
^^^^^
lib/rubocop/graphql/field/kwargs.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class Field
^^^^^
lib/rubocop/graphql/field/kwargs.rb:6:13: C: GraphQL/ObjectDescription: Missing type description
class Kwargs
^^^^^^
lib/rubocop/graphql/schema_member.rb:5:11: C: GraphQL/ObjectDescription: Missing type description
class SchemaMember
^^^^^^^^^^^^
lib/rubocop/graphql/swap_range.rb:5:12: C: GraphQL/ObjectDescription: Missing type description
module SwapRange
^^^^^^^^^
66 files inspected, 30 offenses detected
@@ -93,6 +93,7 @@ def field_name(node) | |||
"`#{first_argument.value}`" | |||
end | |||
|
|||
# @!method argument_declarations(node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an autocorrected by InternalAffairs/NodeMatcherDirective
.
https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/InternalAffairs/NodeMatcherDirective
Checks that node matcher definitions are tagged with a YARD@!method
directive so that editors are able to find the dynamically defined method.
Hi @ydah, thanks for the PR! Could you please explain me a couple of things above? 🙂 |
bundle exec rubocop -a --only InternalAffairs/CopDescription
bundle exec rubocop -a --only InternalAffairs/MethodNameEqual
bundle exec rubocop -a --only InternalAffairs/NodeMatcherDirective
bundle exec rubocop -a --only InternalAffairs/NodeTypePredicate
bundle exec rubocop -a --only InternalAffairs/RedundantDescribedClassAsSubject
bundle exec rubocop -a --only InternalAffairs/RedundantLetRuboCopConfigNew
Could you please also take a look at rubocop failure? 🙂 |
``` spec/rubocop/cop/graphql/argument_description_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/argument_description_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/argument_name_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/argument_name_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/argument_uniqueness_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/argument_uniqueness_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/extract_input_type_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/extract_type_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_definitions_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_description_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_description_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/field_hash_key_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_hash_key_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/field_method_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_method_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/field_name_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_name_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/field_uniqueness_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/field_uniqueness_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/legacy_dsl_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/legacy_dsl_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/object_description_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/object_description_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/ordered_arguments_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/ordered_arguments_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/ordered_fields_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/ordered_fields_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. spec/rubocop/cop/graphql/resolver_method_length_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/unused_argument_spec.rb:4:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. spec/rubocop/cop/graphql/unused_argument_spec.rb:5:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected. ```
f69d0c4
to
2d26c96
Compare
d1a34c6
to
78d8682
Compare
Ops, sorry. I updated this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🙂
This PR is a suggestion to enable effective cop when creating a cop for RuboCop.
It is useful to remind us to forget something without being too noisy.
Refs: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/InternalAffairs