rubocop-iotventure 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +4 -1
- data/Rakefile +2 -2
- data/bin/console +3 -3
- data/lib/rubocop/cop/iotventure/save_request_example.rb +13 -5
- data/lib/rubocop/iotventure/version.rb +1 -1
- data/lib/rubocop/iotventure.rb +3 -3
- data/rubocop-iotventure.gemspec +13 -17
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d0d7b568c5726071030b7e7726c8b23c03a6169e717faf47112d76b6c375fc5
|
4
|
+
data.tar.gz: 229e07f5b7b072d3fcaca91b735227c2e639814f3efc949c135b2c47f8df3d8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c79b83a2cb794ffe161438753b0e161e09afec8b9b845b54d62affe8ed25189efc2932932fd56eee60575c98f0631f944502f55853bed59c52a70fe76e2cde0
|
7
|
+
data.tar.gz: cc8f99a6df08bab9d5351aee184403086d6466727b66df22624187ebae6ff2d226f65f82dc2e17289bb18dc96b27f1b5d762b0183f50adc82ea702deb2fa460a
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rake
|
3
|
+
- rubocop-iotventure
|
4
|
+
|
1
5
|
AllCops:
|
2
6
|
TargetRubyVersion: 2.6
|
3
7
|
NewCops: enable
|
8
|
+
SuggestExtensions: false
|
4
9
|
|
5
10
|
Layout/LineLength:
|
6
11
|
Max: 120
|
@@ -8,6 +13,7 @@ Layout/LineLength:
|
|
8
13
|
Metrics/BlockLength:
|
9
14
|
Exclude:
|
10
15
|
- '**/spec/**/*'
|
16
|
+
- 'rubocop-iotventure.gemspec'
|
11
17
|
|
12
18
|
Naming/FileName:
|
13
19
|
Exclude:
|
data/Gemfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source 'https://rubygems.org'
|
4
4
|
|
5
5
|
# Specify your gem's dependencies in rubocop-iotventure.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem
|
8
|
+
gem 'rake', '~> 13.0'
|
9
9
|
|
10
|
-
gem
|
10
|
+
gem 'rubocop', '~> 1.21'
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop-iotventure (0.1.
|
4
|
+
rubocop-iotventure (0.1.1)
|
5
5
|
rubocop (~> 1.0)
|
6
|
+
rubocop-rake (~> 0.6.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
@@ -46,6 +47,8 @@ GEM
|
|
46
47
|
unicode-display_width (>= 1.4.0, < 3.0)
|
47
48
|
rubocop-ast (1.17.0)
|
48
49
|
parser (>= 3.1.1.0)
|
50
|
+
rubocop-rake (0.6.0)
|
51
|
+
rubocop (~> 1.0)
|
49
52
|
ruby-progressbar (1.11.0)
|
50
53
|
simplecov (0.21.2)
|
51
54
|
docile (~> 1.1)
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rubocop/iotventure'
|
6
6
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -11,5 +11,5 @@ require "rubocop/iotventure"
|
|
11
11
|
# require "pry"
|
12
12
|
# Pry.start
|
13
13
|
|
14
|
-
require
|
14
|
+
require 'irb'
|
15
15
|
IRB.start(__FILE__)
|
@@ -93,15 +93,23 @@ module RuboCop
|
|
93
93
|
private
|
94
94
|
|
95
95
|
def check_for_wrong_save_request_example(node, body_param_name)
|
96
|
-
success_node,
|
96
|
+
success_node, arguments_hash = success_node_and_arguments_hash(node)
|
97
|
+
|
98
|
+
return if success_node.nil?
|
99
|
+
|
100
|
+
return add_missing_offense(success_node, body_param_name) if arguments_hash.empty?
|
101
|
+
|
102
|
+
check_arguments_hash(success_node, body_param_name, arguments_hash.first)
|
103
|
+
end
|
104
|
+
|
105
|
+
def success_node_and_arguments_hash(node)
|
106
|
+
node.children.each do |child|
|
97
107
|
capture = success_response(child)
|
98
108
|
|
99
|
-
|
109
|
+
return child, capture if capture
|
100
110
|
end
|
101
111
|
|
102
|
-
|
103
|
-
|
104
|
-
check_arguments_hash(success_node, body_param_name, arguments_hash_capture.first)
|
112
|
+
[nil, nil]
|
105
113
|
end
|
106
114
|
|
107
115
|
def check_arguments_hash(success_node, body_param_name, arguments_hash)
|
data/lib/rubocop/iotventure.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative 'iotventure/version'
|
4
4
|
|
5
5
|
module RuboCop
|
6
|
+
# A module containing cops created for Iotventure GmbH
|
6
7
|
module Iotventure
|
7
8
|
class Error < StandardError; end
|
8
|
-
|
9
|
+
|
9
10
|
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
10
11
|
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
11
12
|
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
@@ -13,4 +14,3 @@ module RuboCop
|
|
13
14
|
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
14
15
|
end
|
15
16
|
end
|
16
|
-
|
data/rubocop-iotventure.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative 'lib/rubocop/iotventure/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = 'rubocop-iotventure'
|
7
7
|
spec.version = RuboCop::Iotventure::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
8
|
+
spec.authors = ['Fynn Starke']
|
9
|
+
spec.email = ['f.starke@iot-venture.com']
|
10
10
|
|
11
11
|
spec.summary = 'Rswag cops.'
|
12
12
|
spec.description = 'Adds some helpful internal cops'
|
13
13
|
spec.homepage = 'https://rubygems.org/gems/rubocop-iotventure'
|
14
|
-
spec.license =
|
15
|
-
spec.required_ruby_version =
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = '>= 2.6.0'
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
18
|
+
spec.metadata['source_code_uri'] = 'https://bitbucket.org/iotventure/rubocop-iotventure/src'
|
19
|
+
spec.metadata['changelog_uri'] = 'https://bitbucket.org/iotventure/rubocop-iotventure/src/master/CHANGELOG.md'
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -25,21 +25,17 @@ Gem::Specification.new do |spec|
|
|
25
25
|
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
26
26
|
end
|
27
27
|
end
|
28
|
-
spec.bindir =
|
28
|
+
spec.bindir = 'exe'
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
-
spec.require_paths = [
|
31
|
-
|
32
|
-
# Uncomment to register a new dependency of your gem
|
33
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
34
|
-
|
35
|
-
# For more information and examples about making a new gem, checkout our
|
36
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
30
|
+
spec.require_paths = ['lib']
|
37
31
|
|
38
32
|
spec.add_dependency 'rubocop', '~> 1.0'
|
33
|
+
spec.add_dependency 'rubocop-rake', '~> 0.6.0'
|
39
34
|
|
40
35
|
spec.add_development_dependency 'bundler'
|
41
36
|
spec.add_development_dependency 'pry'
|
42
37
|
spec.add_development_dependency 'rake'
|
43
38
|
spec.add_development_dependency 'rspec'
|
44
39
|
spec.add_development_dependency 'simplecov'
|
40
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
45
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-iotventure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fynn Starke
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.6.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.6.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,7 +138,11 @@ files:
|
|
124
138
|
homepage: https://rubygems.org/gems/rubocop-iotventure
|
125
139
|
licenses:
|
126
140
|
- MIT
|
127
|
-
metadata:
|
141
|
+
metadata:
|
142
|
+
homepage_uri: https://rubygems.org/gems/rubocop-iotventure
|
143
|
+
source_code_uri: https://bitbucket.org/iotventure/rubocop-iotventure/src
|
144
|
+
changelog_uri: https://bitbucket.org/iotventure/rubocop-iotventure/src/master/CHANGELOG.md
|
145
|
+
rubygems_mfa_required: 'true'
|
128
146
|
post_install_message:
|
129
147
|
rdoc_options: []
|
130
148
|
require_paths:
|