dev-sec / ssl-baseline

DevSec SSL/TLS Baseline - InSpec Profile
https://dev-sec.io/baselines/ssl/
Apache License 2.0
66 stars 23 forks source link

Fix lint #38

Closed schurzi closed 3 years ago

schurzi commented 3 years ago

for all changes rubocop proposes two different options:

controls/ssl_test.rb:93:13: C: [Corrected] Style/NumericPredicate: Use sslports.length.positive? instead of sslports.length > 0.
  only_if { sslports.length > 0 }
            ^^^^^^^^^^^^^^^^^^^
controls/ssl_test.rb:93:13: C: [Corrected] Style/ZeroLengthPredicate: Use !empty? instead of length > 0.
  only_if { sslports.length > 0 }
            ^^^^^^^^^^^^^^^^^^^

the autofix uses the first option, but in this use case the second fix might be better. sslports.!empty? seems pretty natural and easy to unserstand, so I changed this.