-
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
Fix false positives on number_separator
when the number is wrapped in parentheses.
#2687
Fix false positives on number_separator
when the number is wrapped in parentheses.
#2687
Conversation
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fast PR! Looks good overall, I added two comments to make the code more understadable for future contributors. Please answer the questions I asked and add comments explaining the code where it isn't obvious like suggested.
Source/SwiftLintFramework/Rules/Style/NumberSeparatorRule.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for considering the feedback. This looks good to me now.
Ah, one last thing before I merge this: The SwiftLintBot shows that this change makes many projects considerably slower, which makes sense given the fact, that we run the code for every numeral used in code. We should think about ways to make this faster again, but before doing that we should check that those numbers are actually reliable given that there was an Xcode update recently and that could be behind those changes, too. @marcelofabri Is there a way we can re-run the SwiftLintBot manually on this PR to evaluate performance of changes? Also what is a significant perfmormance change in you opinion that would hold off from merging a bug fix? |
…alse-positive on number_separator
1120b8b
to
2567900
Compare
@Dschee Looks like the performance warnings may have been a false-positive. |
Nice, just took a while to update. Merging. 👏 |
You should be able to retrigger it from Azure Pipelines. However, it's usually better to run locally to be sure and avoid any infrastructure issues (CI is shared, etc). |
"let exp = \(sign)1_000_000.000_000e2" | ||
"let exp = \(sign)1_000_000.000_000e2", | ||
"let foo: Double = \(sign)(200)", | ||
"let foo: Double = \(sign)(200 / 447.214)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a triggering example with parenthesis to document the behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely. I'll make a separate PR.
Resolves: #2683