Skip to content

Commit

Permalink
Merge pull request #277 from datarockets/add-graphql-cops
Browse files Browse the repository at this point in the history
Add graphql cops
  • Loading branch information
Anastastasia-B committed Sep 7, 2023
2 parents d5a1689 + 62ee5d1 commit 5e4ae5a
Show file tree
Hide file tree
Showing 5 changed files with 514 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is described in [Contributing notes](CONTRIBUTING.md#changelog-entry-

## 1.5.0

### Added

* Added GraphQL cops. ([@Anastastasia-B][])

### Changed

* **(Breaking)** Support Ruby >= 2.7.0

* Update rubocop to `1.55.1`. ([@Set27])
Expand Down Expand Up @@ -280,3 +286,4 @@ The format is described in [Contributing notes](CONTRIBUTING.md#changelog-entry-
[@a.branzeanu]: https://github.com/texpert
[@nikitasakov]: https://github.com/nikitasakov
[@paydaylight]: https://github.com/paydaylight
[@Anastastasia-B]: https://github.com/Anastastasia-B
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ inherit_gem:
- config/rails-locales.yml
```
### GraphQL config
To include specific rules for GraphQL, you can add the following config
```yaml
inherit_gem:
datarockets-style:
- config/graphql.yml
```
### Rspec config
For Rspec tests, you can add a special rubocop config
Expand Down
10 changes: 10 additions & 0 deletions config/graphql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require: rubocop-graphql

GraphQL/ExtractInputType:
Enabled: false

GraphQL/ExtractType:
Enabled: false

GraphQL/ResolverMethodLength:
Max: 10
1 change: 1 addition & 0 deletions datarockets-style.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]

spec.add_dependency "rubocop", "~> 1.55.1"
spec.add_dependency "rubocop-graphql", "~> 1.1.1"
spec.add_dependency "rubocop-rails", "~> 2.20.2"
spec.add_dependency "rubocop-rspec", "~> 2.23.0"

Expand Down
Loading

0 comments on commit 5e4ae5a

Please sign in to comment.