-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Format code with latest code style #3975
Conversation
@VishnuSanal Sorry, I missed the #3822 which is very similar to this one. This pull request only suppress one rule with Other standard rules are enabled and fixed one by one manually. Especially for the rule: https://developer.android.com/kotlin/style-guide#import_statements
This rule needs to be fixed by hand one by one which spends lots of time and effort. IMO, we should follow Kotlin code conventions, and disable rules with reasonable purpose. Such as the regex expression in This pull request was created after a myriad of pull requests were merged recently to avoid conflicts. |
@Bambooin i personally wouldn't vouch for a PR with ~350 file changes, since it breaks git history. I think the cost outweighs the benefits. this is why I created the other spotless PR before, it first gave me a whole lot of changes & (just like you did!) I had to try disabling individual rules manually to get to the current amount of files changed (~30 files). requesting for opinions from @VishalNehra @TranceLove & @EmmanuelMess here. |
@VishnuSanal We can use git blame ignore file to skip this commit. For this pull request with too much change is not my git way too, we should keep each commit clean and elegant. |
All CI check and test passed except code static anylysis failed with too long function. |
Can you fix the static code analysis failure as well? Let me know if there's any rule that you would want to ignore for now, but we should be able to fix too long functions. |
There are 9 functions are too lang which exceed maximum length 60. I tried and failed to refactor these too complex functions. Such as this function is 199 lines with new code style.
|
Close it due to it's hard to review and merge conflicts. |
I was planning to merge it with the next release cycle after few days. There were always going to be merge conflicts here, so I'm trying to minimise them by making a release and then starting work on new release after merging this first. |
Waiting for the new release and try to merge or rebaes(hard)... |
Hi, we just published a new release. Can you please rebase and we'll push this to merge. Sorry it took so long. |
I'm not able to see your previous changes here now. Did you remove old commits? |
Disable standard rules which can't be formatted with ktlint automatially.
@VishalNehra The v1 patch is very hard to rebase and code review, so I rewrite the v2 patch from scratch. Sorry for the long waiting time, it's ready to code review right now.
Does this mean the license header? I had updated the license year in the code base. |
SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details. SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier. SLF4J: Ignoring binding found at [jar:file:/home/runner/.gradle/caches/transforms-3/7adcb909ec6a171fc6a1a1c1cf301964/transformed/jetified-logback-classic-1.2.11.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
This issue was introduced in: 7136ff3 Fix by removing old codes and keep the new codes. > ISO 639 is not a stable standard; some of the language codes it defines (specifically "iw", "ji", and "in") have changed. This constructor accepts both the old codes ("iw", "ji", and "in") and the new codes ("he", "yi", and "id"), but all other API on Locale will return only the OLD codes. com.amaze.filemanager.ui.fragments.preferencefragments.UiPrefsFragmentTest > testDefaultBehaviour[28] FAILED java.lang.IllegalArgumentException: list[49] is a repetition at android.os.LocaleList.__constructor__(LocaleList.java:193) at android.os.LocaleList.<init>(LocaleList.java) at androidx.core.os.LocaleListCompat$Api24Impl.createLocaleList(LocaleListCompat.java:341) at androidx.core.os.LocaleListCompat.create(LocaleListCompat.java:77) at androidx.core.os.LocaleListCompat.forLanguageTags(LocaleListCompat.java:172) at com.amaze.filemanager.utils.ContextLocaleExtKt.getLocaleListFromXml(ContextLocaleExt.kt:53) at com.amaze.filemanager.utils.ContextLocaleExtKt.getLangPreferenceDropdownEntries(ContextLocaleExt.kt:62) at com.amaze.filemanager.ui.fragments.preferencefragments.UiPrefsFragment.onCreatePreferences(UiPrefsFragment.kt:55) at androidx.preference.PreferenceFragmentCompat.onCreate(PreferenceFragmentCompat.java:161) at androidx.fragment.app.Fragment.performCreate(Fragment.java:3090)
Description
Format code with latest format tool.
The v2 patch doesn't change any code logic.
I disable some ktlint standard rules in kotlin files:
For these rules, we can fix them in the future pull request one by one.
Unit test is passed and was verified and tested with LineageOS 20.
The left Codacy issues were almost function too long, and this is can be fixed by update setting.
The last commit fix can be cherry pick to
release/3.10
branch.For the pending pull requests:
Issue tracker
Automatic tests
Manual tests
Done
OS: LineageOS 20
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug
./gradlew spotlessCheck