-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Lint/DeprecatedOpenSSLConstant
cop
#7950
Conversation
b30794d
to
0531c1c
Compare
0531c1c
to
1c95752
Compare
Thanks for the review @koic! |
Style/OpenSSLDigestConstant
copLint/OpenSSLDigestConstant
cop
Lint/OpenSSLDigestConstant
copLint/OpenSSLDigestConstant
and Lint/OpenSSLCipherConstant
cop
I think |
We can even go one step further and have a |
af6e2e6
to
1a43961
Compare
Lint/OpenSSLDigestConstant
and Lint/OpenSSLCipherConstant
copLint/OpenSSLDeprecatedConstant
cop
585a5d3
to
8575679
Compare
Merged into one cop. A |
OpenSSL::Cipher::AES{128,192,256} have another initialization form - The cipher mode could be omitted for just these three constants.
needs to be auto-corrected into:
|
8575679
to
94b8331
Compare
Thanks @rhenium! I pushed a fix. |
Lint/OpenSSLDeprecatedConstant
copLint/DeprecatedOpenSSLConstant
cop
94b8331
to
537e620
Compare
537e620
to
d182466
Compare
Thanks! |
Thanks for cutting a cop for this deprecation @bdewater. It makes scoping Ruby upgrades a lot more predictable. |
> Lint/DeprecatedOpenSSLConstant: > Use OpenSSL::Digest.hexdigest('MD5', key_in_der_format) instead of > OpenSSL::Digest::MD5.hexdigest(key_in_der_format). Rubocop has a new cop[1] that detects an upcoming deprecation to the OpenSSL gem[2] that's built into Ruby. [1] rubocop/rubocop#7950 [2] ruby/openssl#366 The previous constant will cause failures in Ruby 3. Signed-off-by: Tim Smith <[email protected]> Signed-off-by: Robb Kidd <[email protected]>
With ruby/openssl#366 the algorithm constants for
OpenSSL::Cipher
andOpenSSL::Digest
are planned to be deprecated, see ruby/openssl#304 for reasoning. This PR aims to introduce two cops to autocorrect this syntax, similar to e.g.Lint/BigDecimalNew
.Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.