-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: Obfuscate shards #1923
feat: Obfuscate shards #1923
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Title does not follow the guidelines of Conventional Commits.
|
Timestamp: 2021-05-14 07:53:33 |
c493ca2
to
1aa1b6c
Compare
* @receiver calculated shards | ||
* @return obfuscated shards | ||
*/ | ||
fun Shards.obfuscate(): Shards = |
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.
Hm... this code is quite hard to read and might be difficult to maintain in the future
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.
I agree that our lint rules are annoying. The first version IMO was much better:
fun Shards.obfuscate(): Shards =
map { shard ->
shard.map { app ->
app.copy(tests = app.tests.map { test ->
test.copy(cases = test.cases.map { case ->
case.copy(name = obfuscationMappings.obfuscateAndroidTestName(case.name))
})
})
}
}
But lint requires newlines after the (
symbol.
@pawelpasterz Any other thoughts?
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.
TBH I never thought about linter. What I meant - code in this form may be error prone. I'm aware it's partially enforced by structure of Shard
(and that is fine).
That's why it's just a comment, not a change request -- I point there might be a problem here in the future, but don't have better solution on my mind
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.
Ok. I have added explicit types and some comments that explain the meaning of this function.
1aa1b6c
to
f4c7736
Compare
3513242
to
68065de
Compare
f2eb727
to
8aa8792
Compare
af53ae1
to
89f2ab5
Compare
Related to #1818
Test Plan
Unit tests pass.
Checklist