Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rubocop-graphql

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubocop-graphql

  • 1.5.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RuboCop::GraphQL

Rubocop extension for enforcing graphql-ruby best practices.

Installation

Install the gem:

gem install rubocop-graphql

If you use bundler put this in your Gemfile:

gem 'rubocop-graphql', require: false

Usage

You need to tell RuboCop to load the GraphQL extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

require: rubocop-graphql

Alternatively, use the following array notation when specifying multiple extensions.

require:
  - rubocop-other-extension
  - rubocop-graphql

Now you can run rubocop and it will automatically load the RuboCop GraphQL cops together with the standard cops.

Command line

rubocop --require rubocop-graphql

Rake task

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-graphql'
end

The Cops

All cops are located under lib/rubocop/cop/graphql, and contain examples and documentation.

In your .rubocop.yml, you may treat the GraphQL cops just like any other cop. For example:

GraphQL/ResolverMethodLength:
  Max: 3

Credits

Initially sponsored by Evil Martians.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/DmitryTsepelev/rubocop-graphql.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 03 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc