rubocop-getninjas 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 491cb49db459d62899ec1484896b5e7f6a86385fa17bdaeabe82c02747d65b6d
4
+ data.tar.gz: d62640fed767f6ad859d8d9d10abe44f33db2d9b181f3efd2c043264d82a1ce4
5
+ SHA512:
6
+ metadata.gz: d480843842cafd8b8e32a7f20aa18ffa3bbdbe2633859404117ff6c37eecb939ccbe9a5071b5d27a1e6815c2113b2169577b4e371386943cc060adae3845072f
7
+ data.tar.gz: f7e5b4d22c4c65b416e7cadba58a721d0c6db485bbad23d7e59e68facccfe4796dacc8399d5e5c58aba2db0e600c677cab28893e5097f093e9a8ce3e7b71df8a
data/.codeclimate.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - ./codeclimate.yml
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ inherit_from:
2
+ - ./rubocop.yml
3
+
4
+ AllCops:
5
+ CacheRootDirectory: tmp/rubocop
6
+
7
+ Rails:
8
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in rubocop-getninjas.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "pry"
data/Gemfile.lock ADDED
@@ -0,0 +1,89 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rubocop-getninjas (0.1.0)
5
+ rubocop (~> 1.31)
6
+ rubocop-performance (~> 1.14.2)
7
+ rubocop-rails (~> 2.15.2)
8
+ rubocop-rspec (~> 2.12.0)
9
+ thor
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (7.0.3.1)
15
+ concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ tzinfo (~> 2.0)
19
+ ast (2.4.2)
20
+ coderay (1.1.3)
21
+ concurrent-ruby (1.1.10)
22
+ diff-lcs (1.5.0)
23
+ i18n (1.12.0)
24
+ concurrent-ruby (~> 1.0)
25
+ json (2.6.2)
26
+ method_source (1.0.0)
27
+ minitest (5.16.2)
28
+ parallel (1.22.1)
29
+ parser (3.1.2.0)
30
+ ast (~> 2.4.1)
31
+ pry (0.13.1)
32
+ coderay (~> 1.1)
33
+ method_source (~> 1.0)
34
+ rack (2.2.4)
35
+ rainbow (3.1.1)
36
+ rake (13.0.6)
37
+ regexp_parser (2.5.0)
38
+ rexml (3.2.5)
39
+ rspec (3.11.0)
40
+ rspec-core (~> 3.11.0)
41
+ rspec-expectations (~> 3.11.0)
42
+ rspec-mocks (~> 3.11.0)
43
+ rspec-core (3.11.0)
44
+ rspec-support (~> 3.11.0)
45
+ rspec-expectations (3.11.0)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.11.0)
48
+ rspec-mocks (3.11.1)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.11.0)
51
+ rspec-support (3.11.0)
52
+ rubocop (1.32.0)
53
+ json (~> 2.3)
54
+ parallel (~> 1.10)
55
+ parser (>= 3.1.0.0)
56
+ rainbow (>= 2.2.2, < 4.0)
57
+ regexp_parser (>= 1.8, < 3.0)
58
+ rexml (>= 3.2.5, < 4.0)
59
+ rubocop-ast (>= 1.19.1, < 2.0)
60
+ ruby-progressbar (~> 1.7)
61
+ unicode-display_width (>= 1.4.0, < 3.0)
62
+ rubocop-ast (1.19.1)
63
+ parser (>= 3.1.1.0)
64
+ rubocop-performance (1.14.3)
65
+ rubocop (>= 1.7.0, < 2.0)
66
+ rubocop-ast (>= 0.4.0)
67
+ rubocop-rails (2.15.2)
68
+ activesupport (>= 4.2.0)
69
+ rack (>= 1.1)
70
+ rubocop (>= 1.7.0, < 2.0)
71
+ rubocop-rspec (2.12.1)
72
+ rubocop (~> 1.31)
73
+ ruby-progressbar (1.11.0)
74
+ thor (1.2.1)
75
+ tzinfo (2.0.5)
76
+ concurrent-ruby (~> 1.0)
77
+ unicode-display_width (2.2.0)
78
+
79
+ PLATFORMS
80
+ ruby
81
+
82
+ DEPENDENCIES
83
+ pry
84
+ rake (~> 13.0)
85
+ rspec (~> 3.0)
86
+ rubocop-getninjas!
87
+
88
+ BUNDLED WITH
89
+ 2.1.4
data/LICENCE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 GetNinjas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Rubocop Getninjas
2
+
3
+ ## Guia de Estilos para o ruby Getninjas
4
+
5
+ # Instalando
6
+
7
+ Adicione isso em seu gem file
8
+
9
+ ```ruby
10
+ gem "rubocop-getninjas"
11
+ ```
12
+
13
+ Então execute
14
+
15
+ ```shell
16
+ $ bundle install
17
+ ```
18
+
19
+ Ou instale local
20
+
21
+ ```shell
22
+ $ gem install rubocop-getninjas
23
+ ```
24
+
25
+ ## Setup
26
+
27
+ Crie na pasta root de seu projeto o arquivo yml `.rubocop.yml` e adicione essa linha no topo do arquivo.
28
+
29
+ ```
30
+ inherit_gem:
31
+ rubocop-getninjas: rubocop.yml
32
+
33
+ ```
34
+
35
+ Após a criação do arquivo, será necessário gerar a lista de ofensas do projeto. Para que posteriormente seja possível fazer as correções necessárias.
36
+
37
+ - Neste passo você terá que gerar um arquivo chamado `rubocop_todo.yml`. Este arquivo é responsável por armazenar a lista de ofensas que o rubocop encontrou baseado em sua política.
38
+
39
+ ```
40
+ rubocop --auto-gen-config
41
+ ```
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "rubocop/getninjas"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'thor'
4
+ require_relative '../lib/rubocop/getninjas/cli.rb'
5
+
6
+ ::Rubocop::Getninjas::Cli.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/codeclimate.yml ADDED
@@ -0,0 +1,4 @@
1
+ plugins:
2
+ rubocop:
3
+ enabled: true
4
+ channel: rubocop-1-31-0
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+ require_relative './version'
5
+ require_relative './install'
6
+
7
+ module Rubocop
8
+ module Getninjas
9
+ VERSION = Rubocop::Getninjas::VERSION
10
+ class Cli < Thor
11
+ desc 'version', 'Display version'
12
+ map %w[-v --version] => :version
13
+
14
+ def version
15
+ say "RubocopGetninjas #{VERSION}"
16
+ end
17
+
18
+ desc 'install', 'Install rubocop for Getninjas'
19
+ def install
20
+ Rubocop::Getninjas::Install.start
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,2 @@
1
+ inherit_gem:
2
+ rubocop-getninjas: rubocop.yml
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+ require 'thor/group'
5
+
6
+ module Rubocop
7
+ module Getninjas
8
+ class Install < Thor::Group
9
+ include Thor::Actions
10
+ source_root File.expand_path('./generators/templates', __dir__)
11
+
12
+ desc 'Create .rubocop.yml'
13
+ def create_rubocop_yml
14
+ copy_file 'rubocop.yml', '.rubocop.yml'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubocop
4
+ module Getninjas
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'pathname'
4
+ require 'yaml'
5
+
6
+ module Rubocop
7
+ module Getninjas
8
+ end
9
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/rubocop/getninjas/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'rubocop-getninjas'
7
+ spec.version = Rubocop::Getninjas::VERSION
8
+ spec.authors = ['Victor Giraldes']
9
+ spec.email = ['victorpgiraldes@gmail.com']
10
+
11
+ spec.summary = 'Custom Style Guide for Getninjas'
12
+ spec.description = 'Write a longer description or delete this line.'
13
+ spec.required_ruby_version = '>= 2.6.0'
14
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
15
+ spec.license = 'MIT'
16
+ spec.bindir = 'bin'
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.require_paths = ['lib']
19
+
20
+ # Uncomment to register a new dependency of your gem
21
+ spec.add_dependency('rubocop', '~> 1.31')
22
+ spec.add_dependency('rubocop-performance', '~> 1.14.2')
23
+ spec.add_dependency('rubocop-rails', '~> 2.15.2')
24
+ spec.add_dependency('rubocop-rspec', '~> 2.12.0')
25
+ spec.add_dependency('thor')
26
+ spec.add_development_dependency('rspec', '~> 3.5')
27
+ end
data/rubocop.yml ADDED
@@ -0,0 +1,140 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-performance
4
+ - rubocop-rails
5
+
6
+ AllCops:
7
+ Exclude:
8
+ - bin/*
9
+ - config.ru
10
+ - config/application.rb
11
+ - config/boot.rb
12
+ - config/environment.rb
13
+ - config/environments/development.rb
14
+ - config/environments/production.rb
15
+ - config/environments/test.rb
16
+ - config/initializers/airbrake.rb
17
+ - config/initializers/application_controller_renderer.rb
18
+ - config/initializers/backtrace_silencers.rb
19
+ - config/initializers/cookies_serializer.rb
20
+ - config/initializers/filter_parameter_logging.rb
21
+ - config/initializers/inflections.rb
22
+ - config/initializers/mime_types.rb
23
+ - config/initializers/wrap_parameters.rb
24
+ - config/puma.rb
25
+ - config/spring.rb
26
+ - db/schema.rb
27
+ - db/seeds/**/*
28
+ - Gemfile.lock
29
+ - Rakefile
30
+ - script/rails
31
+
32
+ Gemspec/RequiredRubyVersion:
33
+ Description: "https://docs.rubocop.org/rubocop/1.31/cops_gemspec.html#gemspecrequiredrubyversion"
34
+ Enabled: false
35
+
36
+ Lint/AmbiguousAssignment:
37
+ Description: Checks for mistyped shorthand assignments.
38
+ Enabled: false
39
+
40
+ Lint/AmbiguousOperator:
41
+ Description: Checks for ambiguous operators in the first argument of a method invocation without parentheses.
42
+ Enabled: false
43
+
44
+ Lint/DisjunctiveAssignmentInConstructor:
45
+ Description: Checks constructors for disjunctive assignments (||=) that should be plain assignments.
46
+ Enabled: false
47
+
48
+ Lint/EmptyInPattern:
49
+ Description: Checks for the presence of in pattern branches without a body.
50
+ Enabled: false
51
+
52
+ Lint/NoReturnInBeginEndBlocks:
53
+ Description: Checks for the presence of a return inside a begin..end block in assignment contexts
54
+ Enabled: true
55
+
56
+ Lint/AmbiguousBlockAssociation:
57
+ Description: Checks for ambiguous block association with method when param passed without parentheses.
58
+ Enabled: true
59
+
60
+ Metrics/AbcSize:
61
+ Description: Checks that the ABC size of methods is not higher than the configured maximum.
62
+ Enabled: true
63
+
64
+ Metrics/ClassLength:
65
+ Description: Avoid class longer than 250 lines
66
+ Enabled: true
67
+ Max: 250
68
+
69
+ Metrics/MethodLength:
70
+ Description: Checks if the length of a method exceeds some maximum value.
71
+ Enabled: false
72
+
73
+ Metrics/ModuleLength:
74
+ Description: Avoid module longer than 250 lines
75
+ Enabled: true
76
+ Max: 250
77
+
78
+ Metrics/ParameterLists:
79
+ Description: Checks for methods with too many parameters.
80
+ Enabled: true
81
+ CountKeywordArgs: true
82
+ Max: 5
83
+
84
+ Metrics/CyclomaticComplexity:
85
+ Description: Checks that the cyclomatic complexity of methods is not higher than the configured maximum.
86
+ Enabled: true
87
+ Max: 7
88
+
89
+ Naming/VariableNumber:
90
+ Description: Makes sure that all numbered variables use the configured style, snake_case, normalcase, or non_integer, for their numbering.
91
+ EnforcedStyle: snake_case
92
+
93
+ RSpec/EmptyExampleGroup:
94
+ Exclude:
95
+ - spec/factories/*
96
+
97
+ RSpec/EmptyLineAfterExampleGroup:
98
+ Exclude:
99
+ - spec/factories/*
100
+
101
+ RSpec/MissingExampleGroupArgument:
102
+ Exclude:
103
+ - spec/factories/*
104
+
105
+ Style/Documentation:
106
+ Description: Checks for missing top-level documentation of classes and modules.
107
+ Enabled: false
108
+
109
+ Style/Lambda:
110
+ Description: (by default) checks for uses of the lambda literal syntax for single line lambdas, and the method call syntax for multiline lambdas.
111
+ EnforcedStyle: literal
112
+
113
+ Style/PercentLiteralDelimiters:
114
+ Description: Enforces the consistent usage of %-literal delimiters.
115
+ PreferredDelimiters:
116
+ '%i': '[]'
117
+ '%I': '[]'
118
+ '%r': ()
119
+ '%w': '[]'
120
+ '%W': '[]'
121
+
122
+ Style/PercentQLiterals:
123
+ Description: Checks for usage of the %Q() syntax when %q() would do.
124
+ EnforcedStyle: upper_case_q
125
+
126
+ Style/StringLiterals:
127
+ Description: Checks if uses of quotes match the configured preference.
128
+ EnforcedStyle: single_quotes
129
+
130
+ Style/StringLiteralsInInterpolation:
131
+ Description: Checks that quotes inside the string interpolation match the configured preference.
132
+ EnforcedStyle: single_quotes
133
+
134
+ Style/TrailingCommaInArrayLiteral:
135
+ Description: Checks for trailing comma in array literals.
136
+ EnforcedStyleForMultiline: comma
137
+
138
+ Style/TrailingCommaInHashLiteral:
139
+ Description: Checks for trailing comma in hash literals.
140
+ EnforcedStyleForMultiline: comma
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-getninjas
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Victor Giraldes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-08-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.31'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.31'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-performance
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.14.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.14.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 2.15.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.15.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.12.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.12.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: thor
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.5'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.5'
97
+ description: Write a longer description or delete this line.
98
+ email:
99
+ - victorpgiraldes@gmail.com
100
+ executables:
101
+ - console
102
+ - rubocop-getninjas
103
+ - setup
104
+ extensions: []
105
+ extra_rdoc_files: []
106
+ files:
107
+ - ".codeclimate.yml"
108
+ - ".gitignore"
109
+ - ".rspec"
110
+ - ".rubocop.yml"
111
+ - ".ruby-version"
112
+ - Gemfile
113
+ - Gemfile.lock
114
+ - LICENCE
115
+ - README.md
116
+ - Rakefile
117
+ - bin/console
118
+ - bin/rubocop-getninjas
119
+ - bin/setup
120
+ - codeclimate.yml
121
+ - lib/rubocop/getninjas.rb
122
+ - lib/rubocop/getninjas/cli.rb
123
+ - lib/rubocop/getninjas/generators/templates/rubocop.yml
124
+ - lib/rubocop/getninjas/install.rb
125
+ - lib/rubocop/getninjas/version.rb
126
+ - rubocop-getninjas.gemspec
127
+ - rubocop.yml
128
+ homepage:
129
+ licenses:
130
+ - MIT
131
+ metadata: {}
132
+ post_install_message:
133
+ rdoc_options: []
134
+ require_paths:
135
+ - lib
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: 2.6.0
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ requirements: []
147
+ rubygems_version: 3.1.4
148
+ signing_key:
149
+ specification_version: 4
150
+ summary: Custom Style Guide for Getninjas
151
+ test_files: []