-
-
Notifications
You must be signed in to change notification settings - Fork 158
feat: add --dry-run option to fix subcommand
#772
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Thank you for your contribution 🚀
I have left some comments. Please take a look at them 👀
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #772 +/- ##
==========================================
- Coverage 99.15% 99.11% -0.04%
==========================================
Files 46 48 +2
Lines 2834 3174 +340
==========================================
+ Hits 2810 3146 +336
- Misses 24 28 +4 ☔ View full report in Codecov by Sentry. |
|
I would also think about the dry-run output format, because the output for multiple files looks a bit cumbersome: $ dotenv-linter fix --dry-run
Fixing .env
Dry run - not changing any files on disk.
DEFAULT_FROM_EMAIL="name\ example@example.ru"
FOO='#comment'
# FOO='#comment'
.env:4 ExtraBlankLine: Extra blank line detected
.env:5 ExtraBlankLine: Extra blank line detected
.env:6 ExtraBlankLine: Extra blank line detected
.env:7 ExtraBlankLine: Extra blank line detected
.env:8 DuplicatedKey: The FOO key is duplicated
Fixing .env.test
Dry run - not changing any files on disk.
FOO=#comment
TEST=nameexample@example.ru
.env.test:1 QuoteCharacter: The value has quote characters (', ")
.env.test:2 UnorderedKey: The FOO key should go before the TEST key
All warnings are fixed. Total: 7@dotenv-linter/core Do you have any suggestions about this? |
|
For dry-run it would be nice to show a formatted diff, something like that: -abc=DEF
-ABC=DEF
A=DEF
ABC=DEF
+# ABC=DEF
+# ABC=DEFBut that might be overkill |
|
@Dev380 Thank you! 👍 |
We'll definitely think about this before releasing the next version 🤔 |
✔ Checklist:
--dry-runflag dotenv-linter.github.io#61