-
Notifications
You must be signed in to change notification settings - Fork 20
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
Remove transitive ktfmt dependencies to prevent kotlin version compatibility issues #392
base: main
Are you sure you want to change the base?
Conversation
I'd say, it's safer to exclude just Kotlin. The reason is: if ktfmt adds another 3p dependency, we might fail to build/run because of that. Regarding the snippet you mentioned: I think it's safe to clean it up OR we could re-declare the |
Hey @cortinico , I spent some time on it, and the small change went into a small to medium refactor. The main thing is:
Which lead to the following additional changes:
I know it got a bit larger then anticipated, but at least the Integration tests did more or less work :D Only some minor changes to the log messages. This is my Proposal. Could you have a look and tell me your oppinion? |
In general I like the direction, but the code is harder to review since is a 1K LOC of changes. |
…fy code workflow and removing access to transitive dependencies (e.g. FormatterException)
… file to base task to align behavior between ktfmtCheck and ktfmtFormat
… to KtfmtBaseTask in order to improve readability
…sspath conflicts
9844b9a
to
00c1a23
Compare
🚀 Description
Hey @cortinico ,
I investigated a bit more the Kotlin update task and wanted to get your opinion before continuing.
I found two ways to make it compile:
Either exclude all transitive dependencies or just exclude the Kotlin stuff as shown below.
I checked the code and unfortunately at one place we use something from a transitive dependency. This is the FormatterException to get the error message. Fun fact, I think the code catched the wrong error? (The ktfmt code annotation its method with the FormatterException while this plugins catched the FormattingError).
So if we remove this peace of code, that might not have worked anyway (at least to my knowledge, please correct me if i am wrong), then we could use
isTransitive=false
and would remove all transitive dependencies. If we want to keep the behavior, we can just exclude the Kotlin lib.When we go either of these ways we have to change / move the behavior of the KtfmtFormatterTest class. This invokes right now directly kftmt, which obviously fails if we exclude some dependencies. I am fine with that, since we can check/test the behavior over the gradle tasks, but I wanted to get your opinion.
So @cortinico I would like to know, if you are okey with excluding the dependencies and what way your prefer ?
📄 Motivation and Context
🧪 How Has This Been Tested?
📦 Types of changes
✅ Checklist