Skip to content
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

Spotless config is using heavily discouraged wildcards #1832

Open
ColtonIdle opened this issue Feb 26, 2025 · 5 comments · May be fixed by #1838
Open

Spotless config is using heavily discouraged wildcards #1832

ColtonIdle opened this issue Feb 26, 2025 · 5 comments · May be fixed by #1838

Comments

@ColtonIdle
Copy link

ColtonIdle commented Feb 26, 2025

diffplug/spotless#111 (comment)

Maintainer of spotless says

Just a bump that src/*/java/**/*.java will perform far better than **/*.java. We heavily discourage **/blah wildcards.

Meanwhile NIA uses the heavily discouraged wildcards

such as

            kotlin {
                target("**/*.kt")
                targetExclude("**/build/**/*.kt")
                ktlint(ktlintVersion).editorConfigOverride(
                    mapOf(
                        "android" to "true",
                    ),
                )
                licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
            }
@Amlsakr
Copy link

Amlsakr commented Mar 9, 2025

@dturner @ColtonIdle Can I work on this issue?

@ColtonIdle
Copy link
Author

Go for it!

@ColtonIdle
Copy link
Author

FWIW, I think the current impl of spotless was also done in NiA to circumvent issues in gradles config cache. but the fact that spotless supports config cache (as of v7) then I think the interesting setup of spotless can be simplified

@Amlsakr
Copy link

Amlsakr commented Mar 14, 2025

@ColtonIdle
I appreciate your clarification.
I have question

  1. Where will the setup for spotless be in init.gradle.kts or build.gradle at App Module ?
    Althoug the spotless is configured in init.gradle.kts file, when I run this command "./gradlew spotlessApply"
    I got this error Task 'spotlessApply' not found in root project 'nowinandroid' and its subprojects.
    Also, when I run this ./gradlew tasks --all, I do not get spotless in tasks
    Is that correct to add the default set up at build.gradle at the App module and build.gradle at project?
    Sorry If I am confused, but it is first time for me to fix issue at open source project.

@Jaehwa-Noh
Copy link
Contributor

Spotless is sperated with main build by init.gradle.kts.
You can run spotless tasks on init.gradle by ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants