Comments (4)
Can you share a build scan?
Also, a minor reproducer would be nice.
@wakingrufus we could probably automatically filter out this directory when the kotlin-dsl plugin is applied. Thoughts?
from ktlint-gradle.
The scan is here: https://scans.gradle.com/s/enzehbyek47qs
Attached a simple reproducer.
gradle-kotlin-buildsrc.zip
from ktlint-gradle.
Can you share a build scan?
Also, a minor reproducer would be nice.
@wakingrufus we could probably automatically filter out this directory when the kotlin-dsl plugin is applied. Thoughts?
We could. I don't see this problem in regular projects using the kotlin-dsl plugin, so what is different about buildSrc that causes this?
from ktlint-gradle.
tl;dr: It looks like something is getting cached in buildSrc/.gradle/buildOutputCleanup/
that's preventing changes to excludes from being honored.
I ran into this same problem: ktlint was reporting errors in the Kotlin code that Gradle generates in buildSrc/
. I added an exclude like this...
ktlint {
filter {
exclude {
it.file.relativeTo(projectDir).startsWith(File("build"))
}
}
}
...and it continued reporting these errors. Eventually I used git clean
to delete all ignored files from my repo, and then it started working.
I was able to narrow the problem down to buildSrc/.gradle/buildOutputCleanup/
by conducting the following series of tests:
- Start from a clean repo, with the above exclude: WORKS
- Remove exclude: FAILS
- Add exclude back: FAILS
rm -rf buildSrc/.gradle/
: WORKS- Remove exclude: FAILS
- Add exclude back: FAILS
rm -rf buildSrc/.gradle/kotlin/
: FAILSrm -rf buildSrc/.gradle/buildOutputCleanup/
: WORKS- Remove exclude: FAILS
- Add exclude back: FAILS
rm -rf buildSrc/.gradle/buildOutputCleanup/
: WORKS
"WORKS" and "FAILS" indicate the outcome of running ./gradlew :buildSrc:ktlintCheck
after the corresponding operation.
from ktlint-gradle.
Related Issues (20)
- Ktlint Fails to Detect Formatting Issues in Nested Modules HOT 7
- Failing Builds Automatically HOT 1
- Same Issue HOT 6
- Using this plugin with the official IntelliJ IDE plugin HOT 4
- K2 issue: A failure occurred while executing worker.KtLintWorkAction FILE HOT 2
- Ktlint checks generated source since 12.1.0 HOT 6
- Task KtlintMainSourceSetCheck failed HOT 2
- Task :runKtlintCheckOverMainSourceSet FAILED HOT 3
- import checks HOT 1
- Caches work incorrectly: additionalEditorconfig should be @Input instead of @Internal HOT 3
- Filter to exclude a generated dir is not working in version 12.1.0 HOT 3
- ktlint pre-commit hook HOT 1
- Using ktlint-gradle with ktlint-intellij-plugin and baseline file
- Is there way to know which (maximum) ktlint versions are supported? HOT 2
- Version number in documentation
- deprecate old android flag
- unknown ktlint version HOT 2
- hxgc
- Deprecation warning with `ActionUpdateThread` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktlint-gradle.