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

Reduce probability of breaking binary compatibility - stop using data classes in public API #2133

Closed
mateuszkwiecinski opened this issue Jul 15, 2023 · 2 comments · Fixed by #2136

Comments

@mateuszkwiecinski
Copy link
Contributor

Expected Behavior

As per https://kotlinlang.org/docs/jvm-api-guidelines-backward-compatibility.html#don-t-use-data-classes-in-an-api data classes aren't recommended to be used in public library API, since they can easily lead to breaking binary compatibility.

Related issues:

Current Behavior

data classes are used in the public api, which may have impact on post-1.0 binary compatibility

Additional information

I'm creating this issue as a result of this comment.

@mateuszkwiecinski
Copy link
Contributor Author

https://github.com/drewhamilton/Poko could be helpful for classes like LintError or KtlintCliError where the customequals/hashCode (and toString?) are part of the public api

@paul-dingemans
Copy link
Collaborator

data classes are used in the public api, which may have impact on post-1.0 binary compatibility

I prefer that this is resolved before of at latest in the 1.0 version of ktlint. If needed, I am willing to consider to release a 0.51.0 version of ktlint and defer the 1.0 release.

@paul-dingemans paul-dingemans added this to the 1.0 (Yeah!) milestone Jul 16, 2023
mateuszkwiecinski added a commit to mateuszkwiecinski/ktlint that referenced this issue Jul 16, 2023
mateuszkwiecinski added a commit to mateuszkwiecinski/ktlint that referenced this issue Jul 18, 2023
mateuszkwiecinski added a commit to mateuszkwiecinski/ktlint that referenced this issue Jul 18, 2023
paul-dingemans pushed a commit to mateuszkwiecinski/ktlint that referenced this issue Jul 25, 2023
mateuszkwiecinski added a commit to mateuszkwiecinski/ktlint that referenced this issue Jul 26, 2023
mateuszkwiecinski added a commit to mateuszkwiecinski/ktlint that referenced this issue Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants