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

Incremental task #310

Open
AnthonyPct opened this issue Feb 2, 2023 · 4 comments
Open

Incremental task #310

AnthonyPct opened this issue Feb 2, 2023 · 4 comments

Comments

@AnthonyPct
Copy link

Hi,

I'm not sure i really understand incremental task.
I integrate the plugging in my android app, in build.gradle.kts.

If i just launch lintFormat the first time, all files will be check.
But if i run a second time, only changed files should be checked, right ?

I tried many things, but every files is checked every times.
I must be missing something

@jeremymailen
Copy link
Owner

The lintKotlin task is incremental and only checks files which are changed since last check.
The formatKotlin task however always runs on all files I generally this is ok since it is not part of workflow like check which is invoked often.

@ajeihala
Copy link

ajeihala commented Feb 7, 2023

Actually, formatKotlin can be a part of a workflow and be invoked often. I have it in the git hooks, running the formatKotlin on each commit locally, which I see takes noticeable time already.

The reason why it's not lintKotlin instead is that we let it commit and immediately show "new changes" for the re-formatted things, making them visible and being automatically fixed when possible. Otherwise with lintKotlin it would require first failing and then running formatKotlin additionally just to get automatic fixes.

@jeremymailen
Copy link
Owner

If I remember right, the wrinkle here is that formatKotlin modifies the files which are its inputs, so when we tried to make it incremental the behavior wasn't quite what one would expect.

@peshrus
Copy link

peshrus commented Dec 12, 2023

Hi @jeremymailen,

Would it be a problem to use the following code here?

p.files.from(inputChanges.getFileChanges(source))

Just an idea, I didn't have a chance to analyze it more deeply.

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

No branches or pull requests

4 participants