Anki-Android
Anki-Android copied to clipboard
Cleaning: replacing `format` by formatted strings
This is part of Kotlin clean-up #10489, low priority, a way to slightly improve code quality and make easy changes.
There are currently 37 occurrences of String.format
in Kotlin followed by a String literal. In Kotlin, you can generally use Template stings, which I find more readable. It'd be nice to replace them. In short, if you don't know string literals, you just have to use $varName or ${expression}. So for example you'd use "$appName $pkgVersionName"
instead of "String.format("%s v%s", appName, pkgVersionName)"
.
If it's not too hard, I appreciate if you can do one change by pull request; unless multiple changes are very strongly related. This way, those PR can be merged very quickly; and if there is an issue, I don't have to delay all other changes.
You don't have to ask permission to work on this. Just look at the answer below to see links to PR already done. I'll try to merge them quickly. Hopefully, most change should be done in less than a minute, so the risk of wasted work is really small
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Can I work on this?
@sparkyniner please note this in the description:
If it's not too hard, I appreciate if you can do one change by pull request; unless multiple changes are very strongly related. This way, those PR can be merged very quickly; and if there is an issue, I don't have to delay all other changes.
You don't have to ask permission to work on this. Just look at the answer below to see links to PR already done. I'll try to merge them quickly. Hopefully, most change should be done in less than a minute, so the risk of wasted work is really small
emphasis added
Was busy with some other PR, will work on this asap.
Hello, I have issued a PR and changed one instance in one file as requested, if this is ok I can change the other 36 instances.
I just edited the issue message to be explicit about locales. Essentially that this issue is mostly about format
that are applied directly to a format string, and is not about ones where locale are explicit.
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
IMO, this should be closed because:
- It is open-ended
- The added value is infimal
- It becomes harder with each removal of String.format
- Our human resources (contributors and reviewers' time) are quite limited, so it's better to spend it on other issues
I'll give at least a week for anyone else to disagree. If there are no complaints, I'll be closing this
is somebody working on this?
is somebody working on this?
This issue is going to be closed, so there shouldn't be anyone working on this