net-ssh 6.0.2 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -1
  3. data/.dockerignore +6 -0
  4. data/.github/config/rubocop_linter_action.yml +4 -0
  5. data/.github/workflows/ci-with-docker.yml +44 -0
  6. data/.github/workflows/ci.yml +87 -0
  7. data/.github/workflows/rubocop.yml +16 -0
  8. data/.gitignore +2 -0
  9. data/.rubocop.yml +12 -1
  10. data/.rubocop_todo.yml +474 -375
  11. data/CHANGES.txt +51 -3
  12. data/Dockerfile +27 -0
  13. data/Dockerfile.openssl3 +17 -0
  14. data/Gemfile +2 -0
  15. data/Gemfile.noed25519 +2 -0
  16. data/README.md +19 -8
  17. data/Rakefile +59 -0
  18. data/SECURITY.md +4 -0
  19. data/docker-compose.yml +23 -0
  20. data/lib/net/ssh/authentication/agent.rb +29 -13
  21. data/lib/net/ssh/authentication/certificate.rb +14 -11
  22. data/lib/net/ssh/authentication/constants.rb +0 -1
  23. data/lib/net/ssh/authentication/ed25519.rb +12 -7
  24. data/lib/net/ssh/authentication/ed25519_loader.rb +4 -7
  25. data/lib/net/ssh/authentication/key_manager.rb +46 -34
  26. data/lib/net/ssh/authentication/methods/abstract.rb +12 -3
  27. data/lib/net/ssh/authentication/methods/hostbased.rb +3 -5
  28. data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +2 -2
  29. data/lib/net/ssh/authentication/methods/none.rb +6 -9
  30. data/lib/net/ssh/authentication/methods/password.rb +2 -3
  31. data/lib/net/ssh/authentication/methods/publickey.rb +56 -16
  32. data/lib/net/ssh/authentication/pageant.rb +97 -97
  33. data/lib/net/ssh/authentication/pub_key_fingerprint.rb +2 -2
  34. data/lib/net/ssh/authentication/session.rb +18 -17
  35. data/lib/net/ssh/buffer.rb +71 -51
  36. data/lib/net/ssh/buffered_io.rb +24 -25
  37. data/lib/net/ssh/config.rb +33 -20
  38. data/lib/net/ssh/connection/channel.rb +84 -82
  39. data/lib/net/ssh/connection/constants.rb +0 -4
  40. data/lib/net/ssh/connection/event_loop.rb +30 -24
  41. data/lib/net/ssh/connection/keepalive.rb +12 -12
  42. data/lib/net/ssh/connection/session.rb +109 -108
  43. data/lib/net/ssh/connection/term.rb +56 -58
  44. data/lib/net/ssh/errors.rb +12 -12
  45. data/lib/net/ssh/key_factory.rb +7 -8
  46. data/lib/net/ssh/known_hosts.rb +84 -15
  47. data/lib/net/ssh/loggable.rb +8 -9
  48. data/lib/net/ssh/packet.rb +1 -1
  49. data/lib/net/ssh/prompt.rb +9 -11
  50. data/lib/net/ssh/proxy/command.rb +1 -1
  51. data/lib/net/ssh/proxy/errors.rb +2 -4
  52. data/lib/net/ssh/proxy/http.rb +18 -20
  53. data/lib/net/ssh/proxy/https.rb +8 -10
  54. data/lib/net/ssh/proxy/jump.rb +8 -10
  55. data/lib/net/ssh/proxy/socks4.rb +2 -4
  56. data/lib/net/ssh/proxy/socks5.rb +3 -5
  57. data/lib/net/ssh/service/forward.rb +7 -7
  58. data/lib/net/ssh/test/channel.rb +24 -26
  59. data/lib/net/ssh/test/extensions.rb +35 -35
  60. data/lib/net/ssh/test/kex.rb +6 -8
  61. data/lib/net/ssh/test/local_packet.rb +0 -2
  62. data/lib/net/ssh/test/packet.rb +3 -3
  63. data/lib/net/ssh/test/remote_packet.rb +6 -8
  64. data/lib/net/ssh/test/script.rb +25 -27
  65. data/lib/net/ssh/test/socket.rb +12 -15
  66. data/lib/net/ssh/test.rb +4 -5
  67. data/lib/net/ssh/transport/algorithms.rb +37 -21
  68. data/lib/net/ssh/transport/cipher_factory.rb +28 -28
  69. data/lib/net/ssh/transport/constants.rb +3 -3
  70. data/lib/net/ssh/transport/ctr.rb +7 -7
  71. data/lib/net/ssh/transport/hmac/abstract.rb +4 -5
  72. data/lib/net/ssh/transport/hmac/md5.rb +0 -2
  73. data/lib/net/ssh/transport/hmac/md5_96.rb +0 -2
  74. data/lib/net/ssh/transport/hmac/none.rb +0 -2
  75. data/lib/net/ssh/transport/hmac/ripemd160.rb +0 -2
  76. data/lib/net/ssh/transport/hmac/sha1.rb +0 -2
  77. data/lib/net/ssh/transport/hmac/sha1_96.rb +0 -2
  78. data/lib/net/ssh/transport/hmac.rb +12 -12
  79. data/lib/net/ssh/transport/identity_cipher.rb +11 -13
  80. data/lib/net/ssh/transport/kex/abstract.rb +12 -5
  81. data/lib/net/ssh/transport/kex/abstract5656.rb +1 -1
  82. data/lib/net/ssh/transport/kex/curve25519_sha256.rb +2 -1
  83. data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +4 -4
  84. data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb +11 -0
  85. data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +21 -21
  86. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +1 -2
  87. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +2 -2
  88. data/lib/net/ssh/transport/kex.rb +8 -6
  89. data/lib/net/ssh/transport/key_expander.rb +7 -8
  90. data/lib/net/ssh/transport/openssl.rb +51 -26
  91. data/lib/net/ssh/transport/packet_stream.rb +2 -3
  92. data/lib/net/ssh/transport/server_version.rb +17 -16
  93. data/lib/net/ssh/transport/session.rb +9 -7
  94. data/lib/net/ssh/transport/state.rb +43 -43
  95. data/lib/net/ssh/verifiers/accept_new.rb +0 -2
  96. data/lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb +1 -2
  97. data/lib/net/ssh/verifiers/always.rb +6 -4
  98. data/lib/net/ssh/verifiers/never.rb +0 -2
  99. data/lib/net/ssh/version.rb +3 -3
  100. data/lib/net/ssh.rb +11 -7
  101. data/net-ssh-public_cert.pem +8 -8
  102. data/net-ssh.gemspec +2 -2
  103. data/support/ssh_tunnel_bug.rb +3 -3
  104. data.tar.gz.sig +0 -0
  105. metadata +24 -15
  106. metadata.gz.sig +0 -0
  107. data/.travis.yml +0 -52
data/.rubocop_todo.yml CHANGED
@@ -1,72 +1,29 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2019-09-10 17:13:26 +0200 using RuboCop version 0.74.0.
3
+ # on 2022-04-29 12:31:14 UTC using RuboCop version 1.28.2.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 76
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: EnforcedStyle, IndentationWidth.
12
- # SupportedStyles: with_first_argument, with_fixed_indentation
13
- Layout/AlignArguments:
14
- Enabled: false
15
-
16
- # Offense count: 57
17
- # Cop supports --auto-correct.
18
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
19
- # SupportedHashRocketStyles: key, separator, table
20
- # SupportedColonStyles: key, separator, table
21
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
22
- Layout/AlignHash:
9
+ # Offense count: 1
10
+ # This cop supports safe auto-correction (--auto-correct).
11
+ # Configuration parameters: Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/RequireMFA:
23
14
  Exclude:
24
- - 'lib/net/ssh/key_factory.rb'
25
- - 'lib/net/ssh/transport/cipher_factory.rb'
26
- - 'lib/net/ssh/transport/hmac.rb'
27
- - 'lib/net/ssh/transport/kex.rb'
28
- - 'test/test_config.rb'
29
-
30
- # Offense count: 70
31
- # Cop supports --auto-correct.
32
- Layout/EmptyLineAfterGuardClause:
33
- Enabled: false
34
-
35
- # Offense count: 170
36
- # Cop supports --auto-correct.
37
- # Configuration parameters: EnforcedStyle.
38
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
39
- Layout/EmptyLinesAroundModuleBody:
40
- Enabled: false
15
+ - 'net-ssh.gemspec'
41
16
 
42
- # Offense count: 2
43
- # Cop supports --auto-correct.
17
+ # Offense count: 1
18
+ # This cop supports safe auto-correction (--auto-correct).
44
19
  # Configuration parameters: EnforcedStyle, IndentationWidth.
45
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
46
- Layout/IndentFirstArrayElement:
47
- Exclude:
48
- - 'lib/net/ssh/transport/openssl.rb'
49
-
50
- # Offense count: 3
51
- # Cop supports --auto-correct.
52
- Layout/LeadingBlankLines:
53
- Exclude:
54
- - 'Rakefile'
55
- - 'lib/net/ssh/authentication/pub_key_fingerprint.rb'
56
- - 'support/arcfour_check.rb'
57
-
58
- # Offense count: 14
59
- # Cop supports --auto-correct.
60
- # Configuration parameters: AllowDoxygenCommentStyle.
61
- Layout/LeadingCommentSpace:
20
+ # SupportedStyles: aligned, indented
21
+ Layout/LineEndStringConcatenationIndentation:
62
22
  Exclude:
63
- - 'test/integration/test_ed25519_pkeys.rb'
64
- - 'test/integration/test_forward.rb'
65
- - 'test/integration/test_id_rsa_keys.rb'
66
- - 'test/integration/test_proxy.rb'
23
+ - 'lib/net/ssh/transport/algorithms.rb'
67
24
 
68
- # Offense count: 23
69
- # Cop supports --auto-correct.
25
+ # Offense count: 7
26
+ # This cop supports safe auto-correction (--auto-correct).
70
27
  # Configuration parameters: EnforcedStyle, IndentationWidth.
71
28
  # SupportedStyles: aligned, indented
72
29
  Layout/MultilineOperationIndentation:
@@ -75,32 +32,9 @@ Layout/MultilineOperationIndentation:
75
32
  - 'lib/net/ssh/proxy/https.rb'
76
33
  - 'lib/net/ssh/transport/algorithms.rb'
77
34
  - 'lib/net/ssh/transport/state.rb'
78
- - 'lib/net/ssh/verifiers/always.rb'
79
- - 'test/authentication/methods/test_hostbased.rb'
80
- - 'test/authentication/methods/test_publickey.rb'
81
-
82
- # Offense count: 16
83
- # Cop supports --auto-correct.
84
- Layout/SpaceAfterColon:
85
- Exclude:
86
- - 'lib/net/ssh/authentication/ed25519.rb'
87
- - 'test/integration/test_ed25519_pkeys.rb'
88
- - 'test/verifiers/test_always.rb'
89
-
90
- # Offense count: 281
91
- # Cop supports --auto-correct.
92
- Layout/SpaceAfterComma:
93
- Enabled: false
94
35
 
95
- # Offense count: 136
96
- # Cop supports --auto-correct.
97
- # Configuration parameters: EnforcedStyle.
98
- # SupportedStyles: space, no_space
99
- Layout/SpaceAroundEqualsInParameterDefault:
100
- Enabled: false
101
-
102
- # Offense count: 10
103
- # Cop supports --auto-correct.
36
+ # Offense count: 5
37
+ # This cop supports safe auto-correction (--auto-correct).
104
38
  # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
105
39
  # SupportedStyles: space, no_space
106
40
  # SupportedStylesForEmptyBraces: space, no_space
@@ -109,12 +43,9 @@ Layout/SpaceInsideBlockBraces:
109
43
  - 'lib/net/ssh/authentication/session.rb'
110
44
  - 'lib/net/ssh/transport/ctr.rb'
111
45
  - 'support/ssh_tunnel_bug.rb'
112
- - 'test/authentication/test_agent.rb'
113
- - 'test/authentication/test_key_manager.rb'
114
- - 'test/start/test_user_nil.rb'
115
46
 
116
47
  # Offense count: 6
117
- # Cop supports --auto-correct.
48
+ # This cop supports safe auto-correction (--auto-correct).
118
49
  # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
119
50
  # SupportedStyles: space, no_space
120
51
  # SupportedStylesForEmptyBrackets: space, no_space
@@ -122,18 +53,18 @@ Layout/SpaceInsideReferenceBrackets:
122
53
  Exclude:
123
54
  - 'lib/net/ssh/transport/algorithms.rb'
124
55
 
125
- # Offense count: 17
126
- # Cop supports --auto-correct.
127
- # Configuration parameters: EnforcedStyle.
128
- # SupportedStyles: final_newline, final_blank_line
129
- Layout/TrailingBlankLines:
130
- Enabled: false
131
-
132
- # Offense count: 739
133
- # Cop supports --auto-correct.
134
- # Configuration parameters: AllowInHeredoc.
135
- Layout/TrailingWhitespace:
136
- Enabled: false
56
+ # Offense count: 11
57
+ # This cop supports safe auto-correction (--auto-correct).
58
+ Lint/AmbiguousOperatorPrecedence:
59
+ Exclude:
60
+ - 'lib/net/ssh/authentication/certificate.rb'
61
+ - 'lib/net/ssh/config.rb'
62
+ - 'lib/net/ssh/loggable.rb'
63
+ - 'lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb'
64
+ - 'lib/net/ssh/transport/openssl.rb'
65
+ - 'lib/net/ssh/transport/state.rb'
66
+ - 'lib/net/ssh/version.rb'
67
+ - 'test/integration/test_proxy.rb'
137
68
 
138
69
  # Offense count: 4
139
70
  # Configuration parameters: AllowSafeAssignment.
@@ -144,98 +75,142 @@ Lint/AssignmentInCondition:
144
75
  - 'lib/net/ssh/proxy/command.rb'
145
76
 
146
77
  # Offense count: 1
147
- Lint/EmptyWhen:
78
+ # Configuration parameters: AllowedMethods.
79
+ # AllowedMethods: enums
80
+ Lint/ConstantDefinitionInBlock:
148
81
  Exclude:
149
- - 'lib/net/ssh/config.rb'
82
+ - 'test/transport/test_cipher_factory.rb'
150
83
 
151
- # Offense count: 9
152
- # Configuration parameters: AllowComments.
153
- Lint/HandleExceptions:
84
+ # Offense count: 1
85
+ # This cop supports safe auto-correction (--auto-correct).
86
+ Lint/DeprecatedClassMethods:
87
+ Exclude:
88
+ - 'lib/net/ssh/transport/packet_stream.rb'
89
+
90
+ # Offense count: 12
91
+ # This cop supports safe auto-correction (--auto-correct).
92
+ Lint/DeprecatedOpenSSLConstant:
154
93
  Exclude:
155
- - 'lib/net/ssh/authentication/session.rb'
156
- - 'lib/net/ssh/known_hosts.rb'
157
94
  - 'lib/net/ssh/transport/openssl.rb'
158
- - 'test/integration/common.rb'
159
- - 'test/integration/test_forward.rb'
160
- - 'test/start/test_connection.rb'
95
+
96
+ # Offense count: 2
97
+ # Configuration parameters: AllowComments, AllowEmptyLambdas.
98
+ Lint/EmptyBlock:
99
+ Exclude:
100
+ - 'test/common.rb'
161
101
  - 'test/start/test_transport.rb'
162
102
 
103
+ # Offense count: 1
104
+ # Configuration parameters: AllowComments.
105
+ Lint/EmptyWhen:
106
+ Exclude:
107
+ - 'lib/net/ssh/config.rb'
108
+
163
109
  # Offense count: 72
164
110
  Lint/ImplicitStringConcatenation:
165
111
  Exclude:
166
112
  - 'lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb'
167
113
  - 'lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb'
168
114
 
169
- # Offense count: 1
170
- Lint/LiteralAsCondition:
115
+ # Offense count: 8
116
+ # This cop supports safe auto-correction (--auto-correct).
117
+ Lint/IncompatibleIoSelectWithFiberScheduler:
171
118
  Exclude:
172
- - 'lib/net/ssh/authentication/pageant.rb'
119
+ - 'lib/net/ssh/buffered_io.rb'
120
+ - 'lib/net/ssh/proxy/command.rb'
121
+ - 'lib/net/ssh/transport/packet_stream.rb'
122
+ - 'lib/net/ssh/transport/server_version.rb'
173
123
 
174
124
  # Offense count: 2
125
+ # This cop supports unsafe auto-correction (--auto-correct-all).
175
126
  Lint/Loop:
176
127
  Exclude:
177
128
  - 'lib/net/ssh/authentication/methods/password.rb'
178
129
  - 'lib/net/ssh/key_factory.rb'
179
130
 
180
131
  # Offense count: 3
181
- # Configuration parameters: MaximumRangeSize.
182
- Lint/MissingCopEnableDirective:
132
+ Lint/MissingSuper:
183
133
  Exclude:
184
- - 'test/authentication/test_agent.rb'
185
- - 'test/authentication/test_certificate.rb'
186
- - 'test/integration/test_agent.rb'
134
+ - 'lib/net/ssh/proxy/jump.rb'
135
+ - 'test/common.rb'
136
+ - 'test/integration/mitm_server.rb'
187
137
 
188
138
  # Offense count: 1
189
139
  Lint/NonLocalExitFromIterator:
190
140
  Exclude:
191
141
  - 'lib/net/ssh/known_hosts.rb'
192
142
 
143
+ # Offense count: 2
144
+ # This cop supports unsafe auto-correction (--auto-correct-all).
145
+ Lint/OrAssignmentToConstant:
146
+ Exclude:
147
+ - 'lib/net/ssh/authentication/pageant.rb'
148
+
149
+ # Offense count: 6
150
+ # This cop supports unsafe auto-correction (--auto-correct-all).
151
+ # Configuration parameters: AllowedImplicitNamespaces.
152
+ # AllowedImplicitNamespaces: Gem
153
+ Lint/RaiseException:
154
+ Exclude:
155
+ - 'Rakefile'
156
+ - 'lib/net/ssh/buffer.rb'
157
+ - 'lib/net/ssh/key_factory.rb'
158
+
159
+ # Offense count: 1
160
+ # This cop supports safe auto-correction (--auto-correct).
161
+ Lint/RedundantCopDisableDirective:
162
+ Exclude:
163
+ - 'lib/net/ssh/key_factory.rb'
164
+
193
165
  # Offense count: 3
194
166
  Lint/RescueException:
195
167
  Exclude:
196
168
  - 'lib/net/ssh/authentication/key_manager.rb'
197
169
  - 'lib/net/ssh/service/forward.rb'
198
170
 
171
+ # Offense count: 4
172
+ # This cop supports safe auto-correction (--auto-correct).
173
+ Lint/SendWithMixinArgument:
174
+ Exclude:
175
+ - 'lib/net/ssh/test/extensions.rb'
176
+
199
177
  # Offense count: 2
200
178
  Lint/ShadowedException:
201
179
  Exclude:
202
180
  - 'lib/net/ssh/authentication/key_manager.rb'
203
181
 
182
+ # Offense count: 5
183
+ # Configuration parameters: AllowComments, AllowNil.
184
+ Lint/SuppressedException:
185
+ Exclude:
186
+ - 'lib/net/ssh/authentication/session.rb'
187
+ - 'lib/net/ssh/transport/openssl.rb'
188
+ - 'test/integration/common.rb'
189
+ - 'test/integration/test_forward.rb'
190
+
204
191
  # Offense count: 1
205
192
  # Configuration parameters: AllowKeywordBlockArguments.
206
193
  Lint/UnderscorePrefixedVariableName:
207
194
  Exclude:
208
195
  - 'lib/net/ssh/test/local_packet.rb'
209
196
 
210
- # Offense count: 1
211
- # Cop supports --auto-correct.
212
- Lint/UnneededRequireStatement:
213
- Exclude:
214
- - 'lib/net/ssh/ruby_compat.rb'
215
-
216
- # Offense count: 60
217
- # Cop supports --auto-correct.
197
+ # Offense count: 15
198
+ # This cop supports safe auto-correction (--auto-correct).
218
199
  # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
219
200
  Lint/UnusedBlockArgument:
220
201
  Exclude:
221
202
  - 'lib/net/ssh/connection/keepalive.rb'
222
203
  - 'lib/net/ssh/connection/session.rb'
223
204
  - 'lib/net/ssh/service/forward.rb'
224
- - 'test/authentication/methods/test_password.rb'
225
- - 'test/authentication/test_agent.rb'
226
- - 'test/common.rb'
227
- - 'test/connection/test_channel.rb'
228
- - 'test/connection/test_session.rb'
229
- - 'test/transport/test_algorithms.rb'
230
- - 'test/transport/test_hmac.rb'
231
205
 
232
- # Offense count: 62
233
- # Cop supports --auto-correct.
234
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
206
+ # Offense count: 74
207
+ # This cop supports safe auto-correction (--auto-correct).
208
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
235
209
  Lint/UnusedMethodArgument:
236
210
  Enabled: false
237
211
 
238
212
  # Offense count: 3
213
+ # This cop supports safe auto-correction (--auto-correct).
239
214
  # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
240
215
  Lint/UselessAccessModifier:
241
216
  Exclude:
@@ -251,13 +226,20 @@ Lint/UselessAssignment:
251
226
  - 'test/integration/common.rb'
252
227
  - 'test/integration/test_forward.rb'
253
228
 
254
- # Offense count: 229
229
+ # Offense count: 1
230
+ # This cop supports unsafe auto-correction (--auto-correct-all).
231
+ Lint/UselessTimes:
232
+ Exclude:
233
+ - 'test/integration/test_forward.rb'
234
+
235
+ # Offense count: 205
236
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
255
237
  Metrics/AbcSize:
256
- Max: 89
238
+ Max: 74
257
239
 
258
- # Offense count: 15
259
- # Configuration parameters: CountComments, ExcludedMethods.
260
- # ExcludedMethods: refine
240
+ # Offense count: 16
241
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
242
+ # IgnoredMethods: refine
261
243
  Metrics/BlockLength:
262
244
  Max: 59
263
245
 
@@ -266,37 +248,37 @@ Metrics/BlockLength:
266
248
  Metrics/BlockNesting:
267
249
  Max: 4
268
250
 
269
- # Offense count: 31
270
- # Configuration parameters: CountComments.
251
+ # Offense count: 33
252
+ # Configuration parameters: CountComments, CountAsOne.
271
253
  Metrics/ClassLength:
272
254
  Max: 488
273
255
 
274
256
  # Offense count: 38
257
+ # Configuration parameters: IgnoredMethods.
275
258
  Metrics/CyclomaticComplexity:
276
- Max: 27
277
- Exclude:
278
- - 'lib/net/ssh/config.rb'
259
+ Max: 32
279
260
 
280
- # Offense count: 211
281
- # Configuration parameters: CountComments, ExcludedMethods.
261
+ # Offense count: 232
262
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
282
263
  Metrics/MethodLength:
283
- Max: 82
264
+ Max: 72
284
265
 
285
- # Offense count: 2
286
- # Configuration parameters: CountComments.
266
+ # Offense count: 3
267
+ # Configuration parameters: CountComments, CountAsOne.
287
268
  Metrics/ModuleLength:
288
269
  Max: 160
289
270
 
290
- # Offense count: 1
291
- # Configuration parameters: CountKeywordArgs.
271
+ # Offense count: 2
272
+ # Configuration parameters: Max, CountKeywordArgs.
292
273
  Metrics/ParameterLists:
293
- Max: 6
274
+ MaxOptionalParameters: 4
294
275
 
295
- # Offense count: 30
276
+ # Offense count: 34
277
+ # Configuration parameters: IgnoredMethods.
296
278
  Metrics/PerceivedComplexity:
297
- Max: 20
279
+ Max: 32
298
280
 
299
- # Offense count: 9
281
+ # Offense count: 10
300
282
  Naming/AccessorMethodName:
301
283
  Exclude:
302
284
  - 'lib/net/ssh/authentication/methods/password.rb'
@@ -308,30 +290,17 @@ Naming/AccessorMethodName:
308
290
  - 'lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb'
309
291
 
310
292
  # Offense count: 2
293
+ # This cop supports safe auto-correction (--auto-correct).
311
294
  Naming/BinaryOperatorParameterName:
312
295
  Exclude:
313
296
  - 'lib/net/ssh/buffer.rb'
314
297
  - 'lib/net/ssh/version.rb'
315
298
 
316
- # Offense count: 12
299
+ # Offense count: 16
300
+ # Configuration parameters: AllowedNames.
301
+ # AllowedNames: module_parent
317
302
  Naming/ClassAndModuleCamelCase:
318
- Exclude:
319
- - 'lib/net/ssh/transport/hmac/md5_96.rb'
320
- - 'lib/net/ssh/transport/hmac/sha1_96.rb'
321
- - 'lib/net/ssh/transport/hmac/sha2_256.rb'
322
- - 'lib/net/ssh/transport/hmac/sha2_256_96.rb'
323
- - 'lib/net/ssh/transport/hmac/sha2_256_etm.rb'
324
- - 'lib/net/ssh/transport/hmac/sha2_512.rb'
325
- - 'lib/net/ssh/transport/hmac/sha2_512_96.rb'
326
- - 'lib/net/ssh/transport/hmac/sha2_512_etm.rb'
327
- - 'test/transport/hmac/test_md5_96.rb'
328
- - 'test/transport/hmac/test_sha1_96.rb'
329
- - 'test/transport/hmac/test_sha2_256.rb'
330
- - 'test/transport/hmac/test_sha2_256_96.rb'
331
- - 'test/transport/hmac/test_sha2_256_etm.rb'
332
- - 'test/transport/hmac/test_sha2_512.rb'
333
- - 'test/transport/hmac/test_sha2_512_96.rb'
334
- - 'test/transport/hmac/test_sha2_512_etm.rb'
303
+ Enabled: false
335
304
 
336
305
  # Offense count: 4
337
306
  Naming/ConstantName:
@@ -340,9 +309,9 @@ Naming/ConstantName:
340
309
  - 'lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb'
341
310
  - 'lib/net/ssh/transport/openssl.rb'
342
311
 
343
- # Offense count: 11
344
- # Configuration parameters: Blacklist.
345
- # Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
312
+ # Offense count: 15
313
+ # Configuration parameters: ForbiddenDelimiters.
314
+ # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
346
315
  Naming/HeredocDelimiterNaming:
347
316
  Exclude:
348
317
  - 'test/authentication/test_agent.rb'
@@ -352,7 +321,7 @@ Naming/HeredocDelimiterNaming:
352
321
  - 'test/integration/test_agent.rb'
353
322
  - 'test/test_key_factory.rb'
354
323
 
355
- # Offense count: 4
324
+ # Offense count: 5
356
325
  # Configuration parameters: EnforcedStyleForLeadingUnderscores.
357
326
  # SupportedStylesForLeadingUnderscores: disallowed, required, optional
358
327
  Naming/MemoizedInstanceVariableName:
@@ -361,7 +330,7 @@ Naming/MemoizedInstanceVariableName:
361
330
  - 'test/authentication/test_key_manager.rb'
362
331
 
363
332
  # Offense count: 32
364
- # Configuration parameters: EnforcedStyle.
333
+ # Configuration parameters: EnforcedStyle, AllowedPatterns, IgnoredPatterns.
365
334
  # SupportedStyles: snake_case, camelCase
366
335
  Naming/MethodName:
367
336
  Exclude:
@@ -374,19 +343,10 @@ Naming/MethodName:
374
343
  - 'test/test_config.rb'
375
344
  - 'test/test_key_factory.rb'
376
345
 
377
- # Offense count: 4
378
- # Cop supports --auto-correct.
379
- # Configuration parameters: PreferredName.
380
- Naming/RescuedExceptionsVariableName:
381
- Exclude:
382
- - 'lib/net/ssh/connection/session.rb'
383
- - 'lib/net/ssh/service/forward.rb'
384
- - 'lib/net/ssh/verifiers/accept_new.rb'
385
-
386
346
  # Offense count: 23
387
347
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
388
- # AllowedNames: io, id, to, by, on, in, at, ip, db
389
- Naming/UncommunicativeMethodParamName:
348
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
349
+ Naming/MethodParameterName:
390
350
  Exclude:
391
351
  - 'lib/net/ssh/authentication/certificate.rb'
392
352
  - 'lib/net/ssh/authentication/ed25519.rb'
@@ -394,24 +354,59 @@ Naming/UncommunicativeMethodParamName:
394
354
  - 'lib/net/ssh/authentication/pageant.rb'
395
355
  - 'lib/net/ssh/buffer.rb'
396
356
  - 'lib/net/ssh/buffered_io.rb'
397
- - 'lib/net/ssh/ruby_compat.rb'
398
357
  - 'lib/net/ssh/test/socket.rb'
399
358
  - 'lib/net/ssh/transport/ctr.rb'
400
359
  - 'lib/net/ssh/transport/hmac/abstract.rb'
401
360
  - 'lib/net/ssh/transport/identity_cipher.rb'
402
361
  - 'test/connection/test_session.rb'
403
362
 
404
- # Offense count: 8
405
- # Configuration parameters: EnforcedStyle.
363
+ # Offense count: 4
364
+ # This cop supports safe auto-correction (--auto-correct).
365
+ # Configuration parameters: PreferredName.
366
+ Naming/RescuedExceptionsVariableName:
367
+ Exclude:
368
+ - 'lib/net/ssh/connection/session.rb'
369
+ - 'lib/net/ssh/service/forward.rb'
370
+ - 'lib/net/ssh/verifiers/accept_new.rb'
371
+
372
+ # Offense count: 5
373
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
374
+ # SupportedStyles: snake_case, normalcase, non_integer
375
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
376
+ Naming/VariableNumber:
377
+ Exclude:
378
+ - 'test/test_buffer.rb'
379
+ - 'test/test_known_hosts.rb'
380
+ - 'test/transport/test_identity_cipher.rb'
381
+
382
+ # Offense count: 1
383
+ # This cop supports unsafe auto-correction (--auto-correct-all).
384
+ Security/IoMethods:
385
+ Exclude:
386
+ - 'lib/net/ssh/config.rb'
387
+
388
+ # Offense count: 2
389
+ # Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
406
390
  # SupportedStyles: inline, group
407
391
  Style/AccessModifierDeclarations:
408
392
  Exclude:
409
393
  - 'lib/net/ssh/authentication/pageant.rb'
410
- - 'lib/net/ssh/transport/openssl.rb'
411
- - 'test/test_key_factory.rb'
394
+
395
+ # Offense count: 31
396
+ # This cop supports safe auto-correction (--auto-correct).
397
+ # Configuration parameters: EnforcedStyle.
398
+ # SupportedStyles: separated, grouped
399
+ Style/AccessorGrouping:
400
+ Exclude:
401
+ - 'lib/net/ssh/authentication/certificate.rb'
402
+ - 'lib/net/ssh/transport/kex/abstract.rb'
403
+ - 'test/common.rb'
404
+ - 'test/connection/test_channel.rb'
405
+ - 'test/integration/mitm_server.rb'
406
+ - 'test/start/test_transport.rb'
412
407
 
413
408
  # Offense count: 2
414
- # Cop supports --auto-correct.
409
+ # This cop supports safe auto-correction (--auto-correct).
415
410
  # Configuration parameters: EnforcedStyle.
416
411
  # SupportedStyles: prefer_alias, prefer_alias_method
417
412
  Style/Alias:
@@ -419,36 +414,19 @@ Style/Alias:
419
414
  - 'lib/net/ssh/connection/session.rb'
420
415
  - 'lib/net/ssh/service/forward.rb'
421
416
 
422
- # Offense count: 31
423
- # Cop supports --auto-correct.
417
+ # Offense count: 9
418
+ # This cop supports safe auto-correction (--auto-correct).
424
419
  # Configuration parameters: EnforcedStyle.
425
420
  # SupportedStyles: always, conditionals
426
421
  Style/AndOr:
427
422
  Exclude:
428
- - 'lib/net/ssh/authentication/key_manager.rb'
429
- - 'lib/net/ssh/buffer.rb'
430
- - 'lib/net/ssh/buffered_io.rb'
431
423
  - 'lib/net/ssh/connection/channel.rb'
432
424
  - 'lib/net/ssh/connection/session.rb'
433
- - 'lib/net/ssh/key_factory.rb'
434
425
  - 'lib/net/ssh/service/forward.rb'
435
- - 'lib/net/ssh/test/channel.rb'
436
- - 'lib/net/ssh/test/script.rb'
437
- - 'lib/net/ssh/transport/cipher_factory.rb'
438
- - 'lib/net/ssh/transport/hmac.rb'
439
- - 'lib/net/ssh/transport/key_expander.rb'
440
- - 'test/common.rb'
441
-
442
- # Offense count: 2
443
- # Configuration parameters: AllowedChars.
444
- Style/AsciiComments:
445
- Exclude:
446
- - 'lib/net/ssh/authentication/pageant.rb'
447
- - 'lib/net/ssh/buffered_io.rb'
448
426
 
449
- # Offense count: 8
450
- # Cop supports --auto-correct.
451
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners.
427
+ # Offense count: 9
428
+ # This cop supports safe auto-correction (--auto-correct).
429
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
452
430
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
453
431
  # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
454
432
  # FunctionalMethods: let, let!, subject, watch
@@ -463,53 +441,41 @@ Style/BlockDelimiters:
463
441
  - 'lib/net/ssh/transport/ctr.rb'
464
442
  - 'test/verifiers/test_always.rb'
465
443
 
466
- # Offense count: 7
467
- # Cop supports --auto-correct.
468
- # Configuration parameters: EnforcedStyle.
469
- # SupportedStyles: braces, no_braces, context_dependent
470
- Style/BracesAroundHashParameters:
471
- Exclude:
472
- - 'lib/net/ssh/config.rb'
473
- - 'test/integration/test_ed25519_pkeys.rb'
474
- - 'test/integration/test_id_rsa_keys.rb'
475
- - 'test/transport/test_hmac.rb'
476
- - 'test/transport/test_session.rb'
477
-
478
444
  # Offense count: 2
445
+ # This cop supports safe auto-correction (--auto-correct).
446
+ # Configuration parameters: AllowOnConstant.
479
447
  Style/CaseEquality:
480
448
  Exclude:
481
449
  - 'lib/net/ssh/buffer.rb'
482
450
  - 'lib/net/ssh/connection/session.rb'
483
451
 
452
+ # Offense count: 3
453
+ # This cop supports unsafe auto-correction (--auto-correct-all).
454
+ Style/CaseLikeIf:
455
+ Exclude:
456
+ - 'lib/net/ssh/transport/openssl.rb'
457
+ - 'test/connection/test_session.rb'
458
+
484
459
  # Offense count: 1
485
- # Cop supports --auto-correct.
460
+ # This cop supports safe auto-correction (--auto-correct).
486
461
  Style/CharacterLiteral:
487
462
  Exclude:
488
463
  - 'test/test_buffer.rb'
489
464
 
490
- # Offense count: 15
491
- # Cop supports --auto-correct.
492
- # Configuration parameters: AutoCorrect, EnforcedStyle.
465
+ # Offense count: 18
466
+ # This cop supports safe auto-correction (--auto-correct).
467
+ # Configuration parameters: EnforcedStyle.
493
468
  # SupportedStyles: nested, compact
494
469
  Style/ClassAndModuleChildren:
470
+ Enabled: false
471
+
472
+ # Offense count: 1
473
+ # This cop supports safe auto-correction (--auto-correct).
474
+ # Configuration parameters: IgnoredMethods.
475
+ # IgnoredMethods: ==, equal?, eql?
476
+ Style/ClassEqualityComparison:
495
477
  Exclude:
496
- - 'lib/net/ssh/transport/ctr.rb'
497
- - 'lib/net/ssh/transport/hmac.rb'
498
- - 'lib/net/ssh/transport/hmac/md5.rb'
499
- - 'lib/net/ssh/transport/hmac/md5_96.rb'
500
- - 'lib/net/ssh/transport/hmac/none.rb'
501
- - 'lib/net/ssh/transport/hmac/ripemd160.rb'
502
- - 'lib/net/ssh/transport/hmac/sha1.rb'
503
- - 'lib/net/ssh/transport/hmac/sha1_96.rb'
504
- - 'lib/net/ssh/transport/hmac/sha2_256.rb'
505
- - 'lib/net/ssh/transport/hmac/sha2_256_96.rb'
506
- - 'lib/net/ssh/transport/hmac/sha2_256_etm.rb'
507
- - 'lib/net/ssh/transport/hmac/sha2_512.rb'
508
- - 'lib/net/ssh/transport/hmac/sha2_512_96.rb'
509
- - 'lib/net/ssh/transport/hmac/sha2_512_etm.rb'
510
- - 'lib/net/ssh/transport/kex.rb'
511
- - 'lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb'
512
- - 'lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb'
478
+ - 'lib/net/ssh/service/forward.rb'
513
479
 
514
480
  # Offense count: 7
515
481
  Style/ClassVars:
@@ -520,15 +486,21 @@ Style/ClassVars:
520
486
  - 'test/authentication/methods/test_publickey.rb'
521
487
 
522
488
  # Offense count: 1
523
- # Cop supports --auto-correct.
489
+ # This cop supports safe auto-correction (--auto-correct).
524
490
  Style/ColonMethodCall:
525
491
  Exclude:
526
492
  - 'lib/net/ssh/authentication/ed25519.rb'
527
493
 
494
+ # Offense count: 2
495
+ Style/CombinableLoops:
496
+ Exclude:
497
+ - 'lib/net/ssh/connection/channel.rb'
498
+ - 'test/integration/test_hmac_etm.rb'
499
+
528
500
  # Offense count: 4
529
- # Cop supports --auto-correct.
530
- # Configuration parameters: Keywords.
531
- # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW
501
+ # This cop supports safe auto-correction (--auto-correct).
502
+ # Configuration parameters: Keywords, RequireColon.
503
+ # Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
532
504
  Style/CommentAnnotation:
533
505
  Exclude:
534
506
  - 'lib/net/ssh/authentication/ed25519.rb'
@@ -537,13 +509,14 @@ Style/CommentAnnotation:
537
509
  - 'lib/net/ssh/config.rb'
538
510
 
539
511
  # Offense count: 3
512
+ # This cop supports safe auto-correction (--auto-correct).
540
513
  Style/CommentedKeyword:
541
514
  Exclude:
542
515
  - 'test/connection/test_session.rb'
543
516
  - 'test/integration/test_forward.rb'
544
517
 
545
518
  # Offense count: 7
546
- # Cop supports --auto-correct.
519
+ # This cop supports safe auto-correction (--auto-correct).
547
520
  # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
548
521
  # SupportedStyles: assign_to_condition, assign_inside_condition
549
522
  Style/ConditionalAssignment:
@@ -554,13 +527,8 @@ Style/ConditionalAssignment:
554
527
  - 'lib/net/ssh/transport/state.rb'
555
528
  - 'test/test_key_factory.rb'
556
529
 
557
- # Offense count: 1
558
- # Cop supports --auto-correct.
559
- Style/DefWithParentheses:
560
- Exclude:
561
- - 'test/integration/test_forward.rb'
562
-
563
- # Offense count: 14
530
+ # Offense count: 12
531
+ # Configuration parameters: AllowedConstants.
564
532
  Style/Documentation:
565
533
  Exclude:
566
534
  - 'spec/**/*'
@@ -568,26 +536,49 @@ Style/Documentation:
568
536
  - 'lib/net/ssh/authentication/ed25519.rb'
569
537
  - 'lib/net/ssh/connection/keepalive.rb'
570
538
  - 'lib/net/ssh/connection/session.rb'
571
- - 'lib/net/ssh/ruby_compat.rb'
572
539
  - 'lib/net/ssh/test/extensions.rb'
573
540
  - 'lib/net/ssh/transport/kex.rb'
574
541
  - 'lib/net/ssh/transport/key_expander.rb'
575
542
  - 'lib/net/ssh/transport/openssl.rb'
576
543
 
577
544
  # Offense count: 1
578
- # Cop supports --auto-correct.
579
- Style/EmptyLiteral:
545
+ # This cop supports safe auto-correction (--auto-correct).
546
+ Style/EvenOdd:
580
547
  Exclude:
581
- - 'lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb'
548
+ - 'lib/net/ssh/buffer.rb'
549
+
550
+ # Offense count: 9
551
+ # This cop supports safe auto-correction (--auto-correct).
552
+ Style/ExplicitBlockArgument:
553
+ Exclude:
554
+ - 'lib/net/ssh/loggable.rb'
555
+ - 'lib/net/ssh/test.rb'
556
+ - 'test/integration/common.rb'
557
+ - 'test/integration/mitm_server.rb'
558
+ - 'test/integration/test_forward.rb'
559
+
560
+ # Offense count: 12
561
+ # This cop supports safe auto-correction (--auto-correct).
562
+ # Configuration parameters: AllowedVars.
563
+ Style/FetchEnvVar:
564
+ Exclude:
565
+ - 'lib/net/ssh.rb'
566
+ - 'lib/net/ssh/authentication/agent.rb'
567
+ - 'lib/net/ssh/authentication/methods/hostbased.rb'
568
+ - 'test/authentication/test_agent.rb'
569
+ - 'test/common.rb'
570
+ - 'test/start/test_options.rb'
571
+ - 'test/test_all.rb'
572
+ - 'test/test_config.rb'
582
573
 
583
574
  # Offense count: 1
584
- # Cop supports --auto-correct.
585
- Style/EvenOdd:
575
+ # This cop supports safe auto-correction (--auto-correct).
576
+ Style/FileWrite:
586
577
  Exclude:
587
- - 'lib/net/ssh/buffer.rb'
578
+ - 'test/integration/test_proxy.rb'
588
579
 
589
580
  # Offense count: 2
590
- # Cop supports --auto-correct.
581
+ # This cop supports safe auto-correction (--auto-correct).
591
582
  # Configuration parameters: EnforcedStyle.
592
583
  # SupportedStyles: format, sprintf, percent
593
584
  Style/FormatString:
@@ -595,33 +586,41 @@ Style/FormatString:
595
586
  - 'lib/net/ssh/authentication/pageant.rb'
596
587
  - 'lib/net/ssh/loggable.rb'
597
588
 
598
- # Offense count: 1
589
+ # Offense count: 174
590
+ # This cop supports safe auto-correction (--auto-correct).
599
591
  # Configuration parameters: EnforcedStyle.
600
- # SupportedStyles: annotated, template, unannotated
601
- Style/FormatStringToken:
602
- Exclude:
603
- - 'lib/net/ssh/loggable.rb'
604
-
605
- # Offense count: 166
606
- # Cop supports --auto-correct.
607
- # Configuration parameters: EnforcedStyle.
608
- # SupportedStyles: always, never
592
+ # SupportedStyles: always, always_true, never
609
593
  Style/FrozenStringLiteralComment:
610
594
  Enabled: false
611
595
 
612
- # Offense count: 34
613
- # Configuration parameters: MinBodyLength.
596
+ # Offense count: 1
597
+ # This cop supports safe auto-correction (--auto-correct).
598
+ Style/GlobalStdStream:
599
+ Exclude:
600
+ - 'lib/net/ssh.rb'
601
+
602
+ # Offense count: 35
603
+ # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
614
604
  Style/GuardClause:
615
605
  Enabled: false
616
606
 
607
+ # Offense count: 3
608
+ # This cop supports safe auto-correction (--auto-correct).
609
+ # Configuration parameters: AllowSplatArgument.
610
+ Style/HashConversion:
611
+ Exclude:
612
+ - 'lib/net/ssh/authentication/certificate.rb'
613
+ - 'test/test_config.rb'
614
+
617
615
  # Offense count: 1
616
+ # This cop supports safe auto-correction (--auto-correct).
618
617
  # Configuration parameters: AllowIfModifier.
619
618
  Style/IfInsideElse:
620
619
  Exclude:
621
620
  - 'lib/net/ssh/connection/session.rb'
622
621
 
623
- # Offense count: 16
624
- # Cop supports --auto-correct.
622
+ # Offense count: 13
623
+ # This cop supports safe auto-correction (--auto-correct).
625
624
  Style/IfUnlessModifier:
626
625
  Exclude:
627
626
  - 'lib/net/ssh.rb'
@@ -629,20 +628,18 @@ Style/IfUnlessModifier:
629
628
  - 'lib/net/ssh/proxy/command.rb'
630
629
  - 'lib/net/ssh/service/forward.rb'
631
630
  - 'lib/net/ssh/transport/ctr.rb'
632
- - 'lib/net/ssh/transport/kex.rb'
633
- - 'lib/net/ssh/transport/kex/abstract5656.rb'
634
631
  - 'lib/net/ssh/transport/key_expander.rb'
635
632
  - 'test/integration/test_proxy.rb'
636
633
  - 'test/test_key_factory.rb'
637
634
 
638
635
  # Offense count: 1
639
- # Cop supports --auto-correct.
636
+ # This cop supports unsafe auto-correction (--auto-correct-all).
640
637
  Style/InfiniteLoop:
641
638
  Exclude:
642
639
  - 'lib/net/ssh/authentication/pageant.rb'
643
640
 
644
641
  # Offense count: 27
645
- # Cop supports --auto-correct.
642
+ # This cop supports safe auto-correction (--auto-correct).
646
643
  Style/LineEndConcatenation:
647
644
  Exclude:
648
645
  - 'lib/net/ssh/authentication/pageant.rb'
@@ -651,9 +648,10 @@ Style/LineEndConcatenation:
651
648
  - 'lib/net/ssh/verifiers/always.rb'
652
649
 
653
650
  # Offense count: 1
654
- Style/MethodMissingSuper:
651
+ # This cop supports unsafe auto-correction (--auto-correct-all).
652
+ Style/MapToHash:
655
653
  Exclude:
656
- - 'lib/net/ssh/connection/session.rb'
654
+ - 'lib/net/ssh/config.rb'
657
655
 
658
656
  # Offense count: 1
659
657
  Style/MissingRespondToMissing:
@@ -661,21 +659,22 @@ Style/MissingRespondToMissing:
661
659
  - 'lib/net/ssh/connection/session.rb'
662
660
 
663
661
  # Offense count: 3
664
- # Cop supports --auto-correct.
662
+ # This cop supports safe auto-correction (--auto-correct).
665
663
  Style/MultilineIfThen:
666
664
  Exclude:
667
665
  - 'lib/net/ssh/buffered_io.rb'
668
666
  - 'lib/net/ssh/service/forward.rb'
669
667
 
670
- # Offense count: 6
671
- # Cop supports --auto-correct.
668
+ # Offense count: 7
669
+ # This cop supports safe auto-correction (--auto-correct).
672
670
  Style/MultilineWhenThen:
673
671
  Exclude:
674
- - 'lib/net/ssh/test/packet.rb'
675
672
  - 'lib/net/ssh/transport/packet_stream.rb'
676
673
  - 'lib/net/ssh/transport/session.rb'
677
674
 
678
675
  # Offense count: 5
676
+ # This cop supports safe auto-correction (--auto-correct).
677
+ # Configuration parameters: AllowMethodComparison.
679
678
  Style/MultipleComparison:
680
679
  Exclude:
681
680
  - 'lib/net/ssh/authentication/agent.rb'
@@ -683,15 +682,15 @@ Style/MultipleComparison:
683
682
  - 'lib/net/ssh/known_hosts.rb'
684
683
  - 'lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb'
685
684
 
686
- # Offense count: 41
687
- # Cop supports --auto-correct.
685
+ # Offense count: 42
686
+ # This cop supports safe auto-correction (--auto-correct).
688
687
  # Configuration parameters: EnforcedStyle.
689
688
  # SupportedStyles: literals, strict
690
689
  Style/MutableConstant:
691
690
  Enabled: false
692
691
 
693
- # Offense count: 13
694
- # Cop supports --auto-correct.
692
+ # Offense count: 14
693
+ # This cop supports safe auto-correction (--auto-correct).
695
694
  # Configuration parameters: EnforcedStyle.
696
695
  # SupportedStyles: both, prefix, postfix
697
696
  Style/NegatedIf:
@@ -706,14 +705,21 @@ Style/NegatedIf:
706
705
  - 'test/test_key_factory.rb'
707
706
  - 'test/transport/test_state.rb'
708
707
 
708
+ # Offense count: 2
709
+ # This cop supports safe auto-correction (--auto-correct).
710
+ Style/NegatedIfElseCondition:
711
+ Exclude:
712
+ - 'lib/net/ssh/transport/algorithms.rb'
713
+ - 'lib/net/ssh/transport/cipher_factory.rb'
714
+
709
715
  # Offense count: 1
710
- # Cop supports --auto-correct.
716
+ # This cop supports safe auto-correction (--auto-correct).
711
717
  Style/NegatedWhile:
712
718
  Exclude:
713
719
  - 'lib/net/ssh/config.rb'
714
720
 
715
721
  # Offense count: 1
716
- # Cop supports --auto-correct.
722
+ # This cop supports safe auto-correction (--auto-correct).
717
723
  # Configuration parameters: EnforcedStyle, MinBodyLength.
718
724
  # SupportedStyles: skip_modifier_ifs, always
719
725
  Style/Next:
@@ -721,7 +727,7 @@ Style/Next:
721
727
  - 'lib/net/ssh/authentication/key_manager.rb'
722
728
 
723
729
  # Offense count: 1
724
- # Cop supports --auto-correct.
730
+ # This cop supports safe auto-correction (--auto-correct).
725
731
  # Configuration parameters: EnforcedStyle.
726
732
  # SupportedStyles: predicate, comparison
727
733
  Style/NilComparison:
@@ -729,26 +735,52 @@ Style/NilComparison:
729
735
  - 'lib/net/ssh/proxy/command.rb'
730
736
 
731
737
  # Offense count: 3
732
- # Cop supports --auto-correct.
738
+ # This cop supports safe auto-correction (--auto-correct).
733
739
  Style/Not:
734
740
  Exclude:
735
741
  - 'lib/net/ssh/connection/channel.rb'
736
742
 
737
- # Offense count: 8
738
- # Cop supports --auto-correct.
739
- # Configuration parameters: Strict.
743
+ # Offense count: 11
744
+ # This cop supports safe auto-correction (--auto-correct).
745
+ # Configuration parameters: Strict, AllowedNumbers.
740
746
  Style/NumericLiterals:
741
747
  MinDigits: 310
742
748
 
743
749
  # Offense count: 29
744
- # Cop supports --auto-correct.
745
- # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
750
+ # This cop supports unsafe auto-correction (--auto-correct-all).
751
+ # Configuration parameters: EnforcedStyle, IgnoredMethods.
746
752
  # SupportedStyles: predicate, comparison
747
753
  Style/NumericPredicate:
748
754
  Enabled: false
749
755
 
756
+ # Offense count: 13
757
+ Style/OpenStructUse:
758
+ Exclude:
759
+ - 'test/authentication/test_ed25519.rb'
760
+ - 'test/common.rb'
761
+ - 'test/transport/kex/test_curve25519_sha256.rb'
762
+ - 'test/transport/kex/test_diffie_hellman_group1_sha1.rb'
763
+ - 'test/transport/kex/test_ecdh_sha2_nistp256.rb'
764
+ - 'test/verifiers/test_always.rb'
765
+
766
+ # Offense count: 16
767
+ # Configuration parameters: AllowedMethods.
768
+ # AllowedMethods: respond_to_missing?
769
+ Style/OptionalBooleanParameter:
770
+ Exclude:
771
+ - 'lib/net/ssh/connection/session.rb'
772
+ - 'lib/net/ssh/key_factory.rb'
773
+ - 'lib/net/ssh/prompt.rb'
774
+ - 'lib/net/ssh/test/channel.rb'
775
+ - 'lib/net/ssh/test/script.rb'
776
+ - 'lib/net/ssh/transport/algorithms.rb'
777
+ - 'lib/net/ssh/transport/session.rb'
778
+ - 'lib/net/ssh/transport/state.rb'
779
+ - 'test/common.rb'
780
+ - 'test/transport/test_server_version.rb'
781
+
750
782
  # Offense count: 15
751
- # Cop supports --auto-correct.
783
+ # This cop supports safe auto-correction (--auto-correct).
752
784
  Style/ParallelAssignment:
753
785
  Exclude:
754
786
  - 'lib/net/ssh/config.rb'
@@ -762,7 +794,7 @@ Style/ParallelAssignment:
762
794
  - 'test/connection/test_channel.rb'
763
795
 
764
796
  # Offense count: 5
765
- # Cop supports --auto-correct.
797
+ # This cop supports safe auto-correction (--auto-correct).
766
798
  # Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions.
767
799
  Style/ParenthesesAroundCondition:
768
800
  Exclude:
@@ -771,16 +803,16 @@ Style/ParenthesesAroundCondition:
771
803
  - 'lib/net/ssh/transport/ctr.rb'
772
804
  - 'test/integration/test_proxy.rb'
773
805
 
774
- # Offense count: 33
775
- # Cop supports --auto-correct.
806
+ # Offense count: 23
807
+ # This cop supports safe auto-correction (--auto-correct).
776
808
  # Configuration parameters: PreferredDelimiters.
777
809
  Style/PercentLiteralDelimiters:
778
810
  Exclude:
779
811
  - 'net-ssh.gemspec'
780
812
  - 'test/test_config.rb'
781
813
 
782
- # Offense count: 15
783
- # Cop supports --auto-correct.
814
+ # Offense count: 17
815
+ # This cop supports safe auto-correction (--auto-correct).
784
816
  Style/PerlBackrefs:
785
817
  Exclude:
786
818
  - 'lib/net/ssh/buffer.rb'
@@ -790,8 +822,8 @@ Style/PerlBackrefs:
790
822
  - 'lib/net/ssh/proxy/socks5.rb'
791
823
  - 'test/integration/common.rb'
792
824
 
793
- # Offense count: 14
794
- # Cop supports --auto-correct.
825
+ # Offense count: 15
826
+ # This cop supports safe auto-correction (--auto-correct).
795
827
  Style/Proc:
796
828
  Exclude:
797
829
  - 'lib/net/ssh/connection/session.rb'
@@ -804,35 +836,72 @@ Style/Proc:
804
836
  - 'test/connection/test_session.rb'
805
837
 
806
838
  # Offense count: 7
807
- # Cop supports --auto-correct.
808
- # Configuration parameters: EnforcedStyle.
839
+ # This cop supports safe auto-correction (--auto-correct).
840
+ # Configuration parameters: EnforcedStyle, AllowedCompactTypes.
809
841
  # SupportedStyles: compact, exploded
810
842
  Style/RaiseArgs:
811
843
  Exclude:
812
844
  - 'lib/net/ssh/authentication/ed25519.rb'
813
845
 
814
- # Offense count: 4
815
- # Cop supports --auto-correct.
846
+ # Offense count: 6
847
+ # This cop supports unsafe auto-correction (--auto-correct-all).
848
+ # Configuration parameters: Methods.
849
+ Style/RedundantArgument:
850
+ Exclude:
851
+ - 'lib/net/ssh/known_hosts.rb'
852
+ - 'test/authentication/test_ed25519.rb'
853
+
854
+ # Offense count: 5
855
+ # This cop supports safe auto-correction (--auto-correct).
816
856
  Style/RedundantBegin:
817
857
  Exclude:
818
858
  - 'lib/net/ssh/buffered_io.rb'
859
+ - 'lib/net/ssh/service/forward.rb'
819
860
  - 'lib/net/ssh/verifiers/accept_new.rb'
820
861
  - 'test/manual/test_pageant.rb'
821
862
 
822
863
  # Offense count: 1
823
- # Cop supports --auto-correct.
824
- Style/RedundantParentheses:
864
+ # This cop supports safe auto-correction (--auto-correct).
865
+ Style/RedundantCondition:
866
+ Exclude:
867
+ - 'lib/net/ssh/proxy/command.rb'
868
+
869
+ # Offense count: 1
870
+ # This cop supports safe auto-correction (--auto-correct).
871
+ Style/RedundantFileExtensionInRequire:
872
+ Exclude:
873
+ - 'lib/net/ssh/transport/cipher_factory.rb'
874
+
875
+ # Offense count: 2
876
+ # This cop supports safe auto-correction (--auto-correct).
877
+ Style/RedundantInterpolation:
878
+ Exclude:
879
+ - 'lib/net/ssh/proxy/socks5.rb'
880
+ - 'lib/net/ssh/transport/session.rb'
881
+
882
+ # Offense count: 2
883
+ # This cop supports safe auto-correction (--auto-correct).
884
+ Style/RedundantPercentQ:
825
885
  Exclude:
826
- - 'support/arcfour_check.rb'
886
+ - 'net-ssh.gemspec'
827
887
 
828
- # Offense count: 59
829
- # Cop supports --auto-correct.
888
+ # Offense count: 11
889
+ # This cop supports safe auto-correction (--auto-correct).
890
+ Style/RedundantRegexpEscape:
891
+ Exclude:
892
+ - 'lib/net/ssh/authentication/agent.rb'
893
+ - 'lib/net/ssh/buffer.rb'
894
+ - 'lib/net/ssh/config.rb'
895
+ - 'lib/net/ssh/transport/cipher_factory.rb'
896
+
897
+ # Offense count: 87
898
+ # This cop supports safe auto-correction (--auto-correct).
830
899
  # Configuration parameters: AllowMultipleReturnValues.
831
900
  Style/RedundantReturn:
832
901
  Enabled: false
833
902
 
834
- # Offense count: 14
835
- # Cop supports --auto-correct.
903
+ # Offense count: 18
904
+ # This cop supports safe auto-correction (--auto-correct).
836
905
  Style/RedundantSelf:
837
906
  Exclude:
838
907
  - 'lib/net/ssh/connection/channel.rb'
@@ -840,16 +909,16 @@ Style/RedundantSelf:
840
909
  - 'test/authentication/test_ed25519.rb'
841
910
 
842
911
  # Offense count: 6
843
- # Cop supports --auto-correct.
912
+ # This cop supports safe auto-correction (--auto-correct).
844
913
  Style/RescueModifier:
845
914
  Exclude:
846
915
  - 'lib/net/ssh/service/forward.rb'
847
916
  - 'lib/net/ssh/transport/algorithms.rb'
848
917
 
849
918
  # Offense count: 25
850
- # Cop supports --auto-correct.
851
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, Whitelist.
852
- # Whitelist: present?, blank?, presence, try, try!
919
+ # This cop supports safe auto-correction (--auto-correct).
920
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
921
+ # AllowedMethods: present?, blank?, presence, try, try!
853
922
  Style/SafeNavigation:
854
923
  Exclude:
855
924
  - 'lib/net/ssh/authentication/key_manager.rb'
@@ -865,14 +934,20 @@ Style/SafeNavigation:
865
934
  - 'lib/net/ssh/transport/algorithms.rb'
866
935
  - 'lib/net/ssh/transport/packet_stream.rb'
867
936
 
937
+ # Offense count: 3
938
+ # This cop supports safe auto-correction (--auto-correct).
939
+ Style/SelectByRegexp:
940
+ Exclude:
941
+ - 'test/test_all.rb'
942
+
868
943
  # Offense count: 2
869
- # Cop supports --auto-correct.
944
+ # This cop supports safe auto-correction (--auto-correct).
870
945
  Style/SelfAssignment:
871
946
  Exclude:
872
947
  - 'lib/net/ssh/config.rb'
873
948
 
874
949
  # Offense count: 7
875
- # Cop supports --auto-correct.
950
+ # This cop supports safe auto-correction (--auto-correct).
876
951
  # Configuration parameters: AllowAsExpressionSeparator.
877
952
  Style/Semicolon:
878
953
  Exclude:
@@ -881,7 +956,7 @@ Style/Semicolon:
881
956
  - 'test/connection/test_session.rb'
882
957
 
883
958
  # Offense count: 2
884
- # Cop supports --auto-correct.
959
+ # This cop supports safe auto-correction (--auto-correct).
885
960
  # Configuration parameters: EnforcedStyle.
886
961
  # SupportedStyles: only_raise, only_fail, semantic
887
962
  Style/SignalException:
@@ -890,16 +965,37 @@ Style/SignalException:
890
965
  - 'lib/net/ssh/connection/channel.rb'
891
966
 
892
967
  # Offense count: 2
893
- # Cop supports --auto-correct.
968
+ # This cop supports safe auto-correction (--auto-correct).
894
969
  # Configuration parameters: AllowIfMethodIsEmpty.
895
970
  Style/SingleLineMethods:
896
971
  Exclude:
897
972
  - 'lib/net/ssh/buffered_io.rb'
898
973
 
974
+ # Offense count: 11
975
+ # This cop supports unsafe auto-correction (--auto-correct-all).
976
+ Style/SlicingWithRange:
977
+ Exclude:
978
+ - 'lib/net/ssh/authentication/ed25519.rb'
979
+ - 'lib/net/ssh/buffer.rb'
980
+ - 'lib/net/ssh/config.rb'
981
+ - 'lib/net/ssh/transport/algorithms.rb'
982
+ - 'lib/net/ssh/transport/packet_stream.rb'
983
+ - 'lib/net/ssh/transport/state.rb'
984
+ - 'test/transport/test_packet_stream.rb'
985
+
986
+ # Offense count: 3
987
+ # This cop supports safe auto-correction (--auto-correct).
988
+ # Configuration parameters: AllowModifier.
989
+ Style/SoleNestedConditional:
990
+ Exclude:
991
+ - 'lib/net/ssh/transport/packet_stream.rb'
992
+ - 'test/common.rb'
993
+ - 'test/integration/test_proxy.rb'
994
+
899
995
  # Offense count: 18
900
- # Cop supports --auto-correct.
901
- # Configuration parameters: EnforcedStyle.
902
- # SupportedStyles: use_perl_names, use_english_names
996
+ # This cop supports safe auto-correction (--auto-correct).
997
+ # Configuration parameters: RequireEnglish, EnforcedStyle.
998
+ # SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
903
999
  Style/SpecialGlobalVars:
904
1000
  Exclude:
905
1001
  - 'lib/net/ssh/authentication/agent.rb'
@@ -910,16 +1006,39 @@ Style/SpecialGlobalVars:
910
1006
  - 'test/manual/test_pageant.rb'
911
1007
  - 'test/test_all.rb'
912
1008
 
913
- # Offense count: 1754
914
- # Cop supports --auto-correct.
1009
+ # Offense count: 1
1010
+ # This cop supports unsafe auto-correction (--auto-correct-all).
1011
+ Style/StringChars:
1012
+ Exclude:
1013
+ - 'test/transport/test_server_version.rb'
1014
+
1015
+ # Offense count: 27
1016
+ # This cop supports unsafe auto-correction (--auto-correct-all).
1017
+ # Configuration parameters: Mode.
1018
+ Style/StringConcatenation:
1019
+ Exclude:
1020
+ - 'lib/net/ssh/authentication/certificate.rb'
1021
+ - 'lib/net/ssh/authentication/key_manager.rb'
1022
+ - 'lib/net/ssh/authentication/pageant.rb'
1023
+ - 'lib/net/ssh/config.rb'
1024
+ - 'lib/net/ssh/transport/algorithms.rb'
1025
+ - 'lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb'
1026
+ - 'test/authentication/test_key_manager.rb'
1027
+ - 'test/integration/common.rb'
1028
+ - 'test/integration/test_proxy.rb'
1029
+ - 'test/test_buffer.rb'
1030
+ - 'test/test_key_factory.rb'
1031
+
1032
+ # Offense count: 1849
1033
+ # This cop supports safe auto-correction (--auto-correct).
915
1034
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
916
1035
  # SupportedStyles: single_quotes, double_quotes
917
1036
  Style/StringLiterals:
918
1037
  Enabled: false
919
1038
 
920
- # Offense count: 11
921
- # Cop supports --auto-correct.
922
- # Configuration parameters: IgnoredMethods.
1039
+ # Offense count: 6
1040
+ # This cop supports unsafe auto-correction (--auto-correct-all).
1041
+ # Configuration parameters: AllowMethodsWithArguments, IgnoredMethods, AllowComments.
923
1042
  # IgnoredMethods: respond_to, define_method
924
1043
  Style/SymbolProc:
925
1044
  Exclude:
@@ -927,40 +1046,27 @@ Style/SymbolProc:
927
1046
  - 'lib/net/ssh/buffer.rb'
928
1047
  - 'lib/net/ssh/connection/session.rb'
929
1048
  - 'lib/net/ssh/test/extensions.rb'
930
- - 'lib/net/ssh/transport/algorithms.rb'
931
- - 'test/integration/test_forward.rb'
932
- - 'test/test/test_test.rb'
933
-
934
- # Offense count: 1
935
- # Cop supports --auto-correct.
936
- Style/UnneededCondition:
937
- Exclude:
938
- - 'lib/net/ssh/proxy/command.rb'
939
-
940
- # Offense count: 4
941
- # Cop supports --auto-correct.
942
- Style/UnneededInterpolation:
943
- Exclude:
944
- - 'lib/net/ssh/proxy/socks5.rb'
945
- - 'lib/net/ssh/transport/session.rb'
946
- - 'test/integration/test_forward.rb'
947
1049
 
948
- # Offense count: 15
949
- # Cop supports --auto-correct.
950
- Style/UnneededPercentQ:
1050
+ # Offense count: 14
1051
+ # This cop supports safe auto-correction (--auto-correct).
1052
+ Style/UnpackFirst:
951
1053
  Exclude:
952
- - 'net-ssh.gemspec'
953
- - 'test/test_config.rb'
1054
+ - 'lib/net/ssh/authentication/pageant.rb'
1055
+ - 'lib/net/ssh/buffer.rb'
1056
+ - 'lib/net/ssh/key_factory.rb'
1057
+ - 'lib/net/ssh/known_hosts.rb'
1058
+ - 'lib/net/ssh/transport/openssl.rb'
1059
+ - 'lib/net/ssh/transport/packet_stream.rb'
954
1060
 
955
1061
  # Offense count: 2
956
- # Cop supports --auto-correct.
1062
+ # This cop supports safe auto-correction (--auto-correct).
957
1063
  Style/WhileUntilDo:
958
1064
  Exclude:
959
1065
  - 'lib/net/ssh/config.rb'
960
1066
  - 'test/integration/common.rb'
961
1067
 
962
- # Offense count: 3
963
- # Cop supports --auto-correct.
1068
+ # Offense count: 4
1069
+ # This cop supports safe auto-correction (--auto-correct).
964
1070
  # Configuration parameters: WordRegex.
965
1071
  # SupportedStyles: percent, brackets
966
1072
  Style/WordArray:
@@ -968,15 +1074,8 @@ Style/WordArray:
968
1074
  MinSize: 3
969
1075
 
970
1076
  # Offense count: 4
971
- # Cop supports --auto-correct.
1077
+ # This cop supports unsafe auto-correction (--auto-correct-all).
972
1078
  Style/ZeroLengthPredicate:
973
1079
  Exclude:
974
1080
  - 'lib/net/ssh/buffered_io.rb'
975
1081
  - 'lib/net/ssh/connection/channel.rb'
976
-
977
- # Offense count: 1636
978
- # Cop supports --auto-correct.
979
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
980
- # URISchemes: http, https
981
- Metrics/LineLength:
982
- Max: 932