KEMBAR78
Consider blank lines in UnorderedKey check by mgrachev · Pull Request #221 · dotenv-linter/dotenv-linter · GitHub
Skip to content

Conversation

@mgrachev
Copy link
Member

@mgrachev mgrachev commented Jun 24, 2020

In some projects, I work with large .env files which have more than 200 lines.
Sorting these files is a really big problem.
The solution is to use groups of lines separated by blank lines. For example:

❌ Wrong
FOO=BAR
BAR=FOO

✅ Correct
BAR=FOO
FOO=BAR

✅ Correct
FOO=BAR

BAR=FOO

✔ Checklist:

  • This PR has been added to CHANGELOG.md (at the top of the list);
  • Tests for the changes have been added (for bug fixes / features);
  • Docs have been added / updated (for bug fixes / features).

@mgrachev mgrachev force-pushed the update-unorderedkey-check branch 2 times, most recently from 45fa8f1 to 0d2073a Compare June 24, 2020 11:38
@mgrachev mgrachev requested a review from a team June 24, 2020 11:52
Copy link
Member

@DDtKey DDtKey left a comment

Choose a reason for hiding this comment

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

This is really very useful change! 🔥

I think this should be the default behavior!
But what do you think about to make this a configurable property? 🤔

Grouped order (default) and full file order (optional)

@mstruebing
Copy link
Member

Making it configurable is a good thing I think, but as you've stated I also think that this should be the default behaviour.
Configurability can also be handled in a separate PR to have small PRs which makes the life of everyone easier :)

@DDtKey
Copy link
Member

DDtKey commented Jun 25, 2020

Making it configurable is a good thing I think, but as you've stated I also think that this should be the default behaviour.
Configurability can also be handled in a separate PR to have small PRs which makes the life of everyone easier :)

Yes, of course, I am fully in favor of this being a separate PR.

@mgrachev mgrachev force-pushed the update-unorderedkey-check branch from 0d2073a to 6818eba Compare June 25, 2020 10:16
@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2020

Codecov Report

Merging #221 into master will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #221      +/-   ##
==========================================
+ Coverage   96.59%   96.66%   +0.06%     
==========================================
  Files          16       16              
  Lines        1469     1499      +30     
==========================================
+ Hits         1419     1449      +30     
  Misses         50       50              
Impacted Files Coverage Δ
src/checks/unordered_key.rs 100.00% <100.00%> (ø)
src/common.rs 95.97% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09a10bb...6818eba. Read the comment docs.

@mgrachev mgrachev force-pushed the update-unorderedkey-check branch 3 times, most recently from 85c118b to 905ea75 Compare June 25, 2020 10:31
Signed-off-by: Mikhail Grachev <work@mgrachev.com>
@mgrachev mgrachev force-pushed the update-unorderedkey-check branch from 905ea75 to 902df3f Compare June 25, 2020 10:39
@DDtKey DDtKey merged commit 0888fe8 into master Jun 25, 2020
@DDtKey DDtKey deleted the update-unorderedkey-check branch June 25, 2020 11:11
@mgrachev
Copy link
Member Author

mgrachev commented Jun 25, 2020

@DDtKey @mstruebing Configurability is a good idea, but I'm not sure that we need it in this check.
Right now, we have very simple checks that are not configurable and implementing this for one check will add extra complexity.

I would like to return to this discussion in the future if we need to implement configurability for several checks.
What do you think?

@mgrachev mgrachev mentioned this pull request Jun 25, 2020
5 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