summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklós Fazekas <mfazekas@szemafor.com>2021-08-03 21:58:57 +0200
committerMiklós Fazekas <mfazekas@szemafor.com>2021-08-03 21:58:57 +0200
commitc082e1afad89f45b93f15341c18afd2cd2177cd0 (patch)
treebb39bc2fc3227b338367b96274784c471a15441c
parent53e38ba90f48d2e289df784c0eaab10c5e6fae5c (diff)
downloadnet-ssh-c082e1afad89f45b93f15341c18afd2cd2177cd0.tar.gz
Rubocop fixes
-rw-r--r--.rubocop_todo.yml90
-rw-r--r--test/integration/common.rb4
2 files changed, 92 insertions, 2 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index d86c153..3c997da 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -988,3 +988,93 @@ Style/ZeroLengthPredicate:
Exclude:
- 'lib/net/ssh/buffered_io.rb'
- 'lib/net/ssh/connection/channel.rb'
+
+Gemspec/DateAssignment: # (new in 1.10)
+ Enabled: true
+
+Layout/SpaceBeforeBrackets: # (new in 1.7)
+ Enabled: true
+
+Lint/AmbiguousAssignment: # (new in 1.7)
+ Enabled: true
+
+Lint/DeprecatedConstants: # (new in 1.8)
+ Enabled: true
+
+Lint/DuplicateBranch: # (new in 1.3)
+ Enabled: true
+
+Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
+ Enabled: true
+
+Lint/EmptyBlock: # (new in 1.1)
+ Enabled: false
+
+Lint/EmptyClass: # (new in 1.3)
+ Enabled: true
+
+Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
+ Enabled: true
+
+Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
+ Enabled: true
+
+Lint/NumberedParameterAssignment: # (new in 1.9)
+ Enabled: true
+
+Lint/OrAssignmentToConstant: # (new in 1.9)
+ Enabled: false
+
+Lint/RedundantDirGlobSort: # (new in 1.8)
+ Enabled: true
+
+Lint/SymbolConversion: # (new in 1.9)
+ Enabled: true
+
+Lint/ToEnumArguments: # (new in 1.1)
+ Enabled: true
+
+Lint/TripleQuotes: # (new in 1.9)
+ Enabled: true
+
+Lint/UnexpectedBlockArity: # (new in 1.5)
+ Enabled: true
+
+Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
+ Enabled: true
+
+Style/ArgumentsForwarding: # (new in 1.1)
+ Enabled: true
+
+Style/CollectionCompact: # (new in 1.2)
+ Enabled: true
+
+Style/DocumentDynamicEvalDefinition: # (new in 1.1)
+ Enabled: true
+
+Style/EndlessMethod: # (new in 1.8)
+ Enabled: true
+
+Style/HashConversion: # (new in 1.10)
+ Enabled: false
+
+Style/HashExcept: # (new in 1.7)
+ Enabled: true
+
+Style/IfWithBooleanLiteralBranches: # (new in 1.9)
+ Enabled: true
+
+Style/NegatedIfElseCondition: # (new in 1.2)
+ Enabled: false
+
+Style/NilLambda: # (new in 1.3)
+ Enabled: true
+
+Style/RedundantArgument: # (new in 1.4)
+ Enabled: false
+
+Style/StringChars: # (new in 1.12)
+ Enabled: false
+
+Style/SwapValues: # (new in 1.1)
+ Enabled: true \ No newline at end of file
diff --git a/test/integration/common.rb b/test/integration/common.rb
index 129e5a4..73eadf8 100644
--- a/test/integration/common.rb
+++ b/test/integration/common.rb
@@ -101,7 +101,7 @@ module IntegrationTestHelpers
end
end
- def is_port_open?(path)
+ def port_open?(path)
Socket.tcp("localhost", 10567, connect_timeout: 1) { true } rescue false # rubocop:disable Style/RescueModifier
end
@@ -112,7 +112,7 @@ module IntegrationTestHelpers
if config
with_lines_as_tempfile(config) do |path, pidpath|
# puts "DEBUG - SSH LOG: #{path}-log.txt"
- raise "A leftover sshd is already running" if is_port_open?(port)
+ raise "A leftover sshd is already running" if port_open?(port)
pid = spawn('sudo', '/opt/net-ssh-openssh/sbin/sshd', '-D', '-f', path, '-p', port) # '-E', "#{path}-log.txt")
sshpidfile = pidpath