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

feat: option to add additionalPlainTextMasks #857

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

dpozinen
Copy link
Contributor

@dpozinen dpozinen commented Sep 5, 2024

What's changed?

Add rewrite.additionalPlainTextMasks plugin option

What's your motivation?

The default list is super long and it was impossible to extend it - only override, which meant users would need to copy paste it + add their additional masks

@timtebeek
Copy link
Contributor

Thanks a lot for this improvement @dpozinen ! That override had been a pain to use for a long time.

Weighing the options now I wonder when folks would want to continue to use the old plainTextMasks if additionalPlainTextMasks is available. 🤔 I don't really see a good use case, beyond perhaps a flimsy "I want a known masked file as Quark instead of PlainText". Do you have any thoughts on that?

If we can't come up with a good use case for the "old" masks field, then we could perhaps look at completely replacing or repurposing that one, as opposed to adding an additional flag.

@timtebeek timtebeek added the enhancement New feature or request label Sep 11, 2024
@dpozinen
Copy link
Contributor Author

Thanks a lot for this improvement @dpozinen ! That override had been a pain to use for a long time.

Weighing the options now I wonder when folks would want to continue to use the old plainTextMasks if additionalPlainTextMasks is available. 🤔 I don't really see a good use case, beyond perhaps a flimsy "I want a known masked file as Quark instead of PlainText". Do you have any thoughts on that?

If we can't come up with a good use case for the "old" masks field, then we could perhaps look at completely replacing or repurposing that one, as opposed to adding an additional flag.

Hi, yeah, I though about that too and figured maybe people would like to limit the scope of their runs for big monorepos, for example excluding .py files. Other than that, you're right, there isn't really a usecase. I'm fine with replacing, but it doesn't seem like a pain to support, and maybe someone is already using that, so it would be a breaking change

@timtebeek
Copy link
Contributor

Hi, yeah, I though about that too and figured maybe people would like to limit the scope of their runs for big monorepos, for example excluding .py files. Other than that, you're right, there isn't really a usecase. I'm fine with replacing, but it doesn't seem like a pain to support, and maybe someone is already using that, so it would be a breaking change

Yes since it's sets we're using here I figured we could fairly silently switch over from interpreting plainTextMasks as replacement to plainTextMasks as additional masks, assuming folks typically include the original plaintext masks and add their own.

That said, there have been cases in the past where folks blocked out excessively large XML files in their repositories using a plain text mask override, so perhaps we shouldn't spring that on folks. 🤔

@dpozinen
Copy link
Contributor Author

Yes since it's sets we're using here I figured we could fairly silently switch over from interpreting plainTextMasks as replacement to plainTextMasks as additional masks, assuming folks typically include the original plaintext masks and add their own.

That said, there have been cases in the past where folks blocked out excessively large XML files in their repositories using a plain text mask override, so perhaps we shouldn't spring that on folks. 🤔

Yeah, that's what I'm saying is this would remove the ability to reduce the scope, which might be valuable for some

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition and helpful discussion weighing the options!

@timtebeek timtebeek merged commit 3a16f55 into openrewrite:main Sep 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants