-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Meaningless variable names #25
Comments
Hello @IIIuminator Adding a list of suffixes sounds like a great idea! I would be happy to have a pull request on that. The part about making FDQN names shorter seems more difficult to get right in all cases, I would prefer postpone it until we have a better understanding of it. Update: We have to think about what happens when someone updates the plugin to a newer version and runs it again. On the other hand, if we change the FDQN to something nicer, it breaks a lot of existing builds, so it's not worth it. Better be conservative. |
Alright. I'll take a look tomorrow. Will take a little time though, have never done any work on a gradle plugin. |
Hold on a bit @IIIuminator Also there is a cool new feature in Gradle 5.1 that will make it easier for you to work on a Gradle plugin without having to publish the plugin locally. I will take care of that and inform you when I am done. |
Yeah sure. I'll wait until it's done. |
on a different project it got the same libraries right.. there's a lot of other stuff as well but nothing with core. /**
* [core-ktx website](https://developer.android.com/tools/extras/support-library.html) */
const val androidx_core_core_ktx: String =
"androidx.core:core-ktx:" + Versions.androidx_core_core_ktx and /**
* [core-ktx website](https://github.com/zTrap/Android-Iconics-Kt) */
const val ru_ztrap_iconics_core_ktx: String =
"ru.ztrap.iconics:core-ktx:" + Versions.ru_ztrap_iconics_core_ktx |
@IIIuminator it's because if two libraries have the same name (here |
Two things: @IIIuminator
// build.gradle(.kts)
buildSrcVersions {
useFdqnFor("core-kt", "core-ktx")
} What do you think? |
yes of course. That helped me notice that I used the wrong version of the same library in one of the apps. Was already thinking something's fishy 😄
sounds good to me. was thinking myself that being able to configure it might be the best solution. Using a config option it should be possible to remedy these really long names too. have a |
@IIIuminator It should be possible in buildSrcVersions 0.3.1 Configuration:
I rewrote the README, have a look |
Looks good. One suggestions: use a |
That would be better but it needs to be interoperable with Groovy and so an Iterable was the simplest way to do that. |
Great plugin, I got some quite useless variable names though:
They are both kotlin extensions but for very different libraries yet cant be distinguished by the variable name. As
kt
andktx
endings are quite common for such libraries maybe check for combinations of that and the meaningless words you already check against would be a good idea. Basically add a list of suffixes.On the other hand some of the constants get very long:
That's the most extreme example I had in my projects. I'd suggest cutting common segments like
github
and TLDs from the name to get something like the following:Still long but better.
I can take a see if I can make a pull request with those changes in the next days. I'm of course open for better solutions, these are just my initial thoughts.
The text was updated successfully, but these errors were encountered: