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

Backend: Detekt Non-Mutable Types in Config #3202

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

DavidArthurCole
Copy link
Contributor

What

Adds a new Detekt rule that enforces that all collections should use mutable types.

Images

image

image

exclude_from_changelog

@github-actions github-actions bot added the Backend A backend pull request that will be merged soon label Jan 10, 2025
@hannibal002
Copy link
Owner

Why do we not want mutable data? Feels lilke a downgrade

@DavidArthurCole
Copy link
Contributor Author

Why do we not want mutable data? Feels lilke a downgrade

We do ... this makes sure all collection types are mutable.

@hannibal002
Copy link
Owner

ok. and why do we not want immutabe types then? same problem

@hannibal002 hannibal002 added this to the Version 2.0.0 milestone Jan 10, 2025
@DavidArthurCole
Copy link
Contributor Author

ok. and why do we not want immutabe types then? same problem

Because it crashes the game if you try to edit a non-mutable collection from the config. It would only happen the first time someone loads the mod, as from GSON it'll be mutable, but still don't want people to crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend A backend pull request that will be merged soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants