-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added hash_value_overflow rule #2496
Conversation
Thanks for the PR @kimdv! Do you think we should be encouraging the use of Swift 4.2's modernized hashing instead? This rule seems especially well suited to avoid using a regular expression to detect the use of For context, the heavy use of regular expressions in SwiftLint have been contributing to performance cliffs and false positives and I would like us to start weaning off of them. |
Thanks, @jpsim! We could do that, but I have just finished a project where we needed custom hashes. I have seen your comments lately on avoiding regular expression, so I really would like to remove the hash regular expression, so can you point where I could look for an example? |
Sure we can do that! @marcelofabri can you maybe point out where to look for inspiration to avoid regular expression? |
@kimdv sounds good for min requirement. If the rule is updated to validate that |
Thanks @marcelofabri! The rule got much simpler 🚀 |
Source/SwiftLintFramework/Rules/Lint/HashValueOverflowRule.swift
Outdated
Show resolved
Hide resolved
Source/SwiftLintFramework/Rules/Lint/HashValueOverflowRule.swift
Outdated
Show resolved
Hide resolved
Source/SwiftLintFramework/Rules/Lint/HashValueOverflowRule.swift
Outdated
Show resolved
Hide resolved
Source/SwiftLintFramework/Rules/Lint/HashValueOverflowRule.swift
Outdated
Show resolved
Hide resolved
@marcelofabri it seems that the tests that are failing is Swiftlint itself. Should i fix those places in Swiftlint where it violates the rule? |
@kimdv Please do it! |
Pushed changes and stuff starts to pass now! 🚀 |
@kimdv Thanks for this - just had some minor comments but overall it looks great! We also need a changelog entry for this change ✨ |
@marcelofabri I rebased with master (Don't know if I did it right) and added your feedback and added changelog entry |
Source/SwiftLintFramework/Extensions/Configuration+Merging.swift
Outdated
Show resolved
Hide resolved
Co-Authored-By: kimdv <kimdevos12@hotmail.com>
@jpsim should be resolved now 🚀 |
Should we name this rule "Legacy Hashing" to align with the other legacy family of rules?
|
Merged! 🎉 Thanks @kimdv ! |
This fixes #2108
I'm not good at all to reggex. So I got a a little help from a friend 😅