KEMBAR78
feat: add `--dry-run` option to fix subcommand by Dev380 · Pull Request #772 · dotenv-linter/dotenv-linter · GitHub
Skip to content

Conversation

@Dev380
Copy link
Contributor

@Dev380 Dev380 commented Apr 8, 2024

✔ Checklist:

@Dev380 Dev380 marked this pull request as ready for review April 8, 2024 17:58
Copy link
Member

@mgrachev mgrachev left a 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-commenter
Copy link

codecov-commenter commented Apr 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.11%. Comparing base (5b6de3a) to head (5d0da32).
Report is 11 commits behind head on master.

❗ 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.
📢 Have feedback on the report? Share it here.

@mgrachev
Copy link
Member

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?

@DDtKey
Copy link
Member

DDtKey commented Apr 12, 2024

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=DEF

But that might be overkill

@mgrachev mgrachev merged commit b92baab into dotenv-linter:master Apr 17, 2024
@mgrachev
Copy link
Member

@Dev380 Thank you! 👍

@mgrachev
Copy link
Member

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=DEF

But that might be overkill

We'll definitely think about this before releasing the next version 🤔

@Dev380 Dev380 deleted the dry-run branch April 18, 2024 02:36
@mgrachev mgrachev mentioned this pull request Aug 6, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants