-
Notifications
You must be signed in to change notification settings - Fork 74
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
Misspelled flags in CLI can cause user data loss #465
Labels
bug
Something isn't working
Comments
Great catch! This is a bug indeed and should be fixed |
grodin
pushed a commit
to grodin/ktfmt
that referenced
this issue
May 17, 2024
grodin
pushed a commit
to grodin/ktfmt
that referenced
this issue
May 17, 2024
grodin
pushed a commit
to grodin/ktfmt
that referenced
this issue
May 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As part of working on #391, I realised that typo'd flags in the CLI don't stop processing. Since ktfmt overwrites files by default, that's pretty dangerous!
E.g.
will report the unexpected option
--dry-runn
but will format and overwriteSomeFile.kt
anyway!I thought this was enough of a showstopper to report it separately.
IMO, all unknown flags should be errors, and no processing should take place when they're encountered.
The text was updated successfully, but these errors were encountered: