KEMBAR78
Implement LeadingCharacterFixer by baile320 · Pull Request #259 · dotenv-linter/dotenv-linter · GitHub
Skip to content

Conversation

@baile320
Copy link
Contributor

@baile320 baile320 commented Aug 14, 2020

This will close: #248

I have a couple comments/questions:

✔ 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).

Delimiters occur between other characters, not at the beginnings of
words, so I updated that and removed a test case (it was also
interfering with LeadingCharacterFixer).
@DDtKey DDtKey requested a review from a team August 14, 2020 08:45
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.

@baile320 👋 Thank you for your contribution! 🚀

I have left some comments. Please take a look at them 👀

@mgrachev
Copy link
Member

mgrachev commented Aug 14, 2020

Good catch! Thank you! 👍
But I'd like you to write a test for that case for the IncorrectDelimiter.

  • Depending on the leading characters, it is still possible to get erroneous UnorderedKeys warnings. I'm not sure the best way to handle this (I made no updates to that), and would like thoughts/suggestions on how to fix (if it should be fixed here) or if it's worthy of a separate PR. There's an illustrative example in my integration test (https://github.com/dotenv-linter/dotenv-linter/compare/master...baile320:leading-char-fixer?expand=1#diff-9aff8b00dfa64d0bf60b17a8b7fe7c20R4-R22)... as you can see, it throws no UnorderedKeys warnings, although it likely should, since after cleaning the keys are technically out of order (the issue is that the checking order includes the */./1 characters at the beginning of the keys, not the "cleaned" versions of the keys).

@evgeniy-r is already working on that feature (#252) 💪

@DDtKey DDtKey mentioned this pull request Aug 14, 2020
3 tasks
@baile320 baile320 requested a review from mgrachev August 14, 2020 11:10
mgrachev
mgrachev previously approved these changes Aug 14, 2020
@mgrachev mgrachev requested a review from a team August 14, 2020 11:13
Bug was introduced into IncorrectDelimiterChecker in previous commit
where "*FOO-BAR=VALUE" would not have risen a warning. Additionally,
LeadingCharacterFixer would not remove all invalid leading chars, just
one. This has also been fixed.
@baile320
Copy link
Contributor Author

I merged in the changes from #267 and made some other relatively minor changes related to test names, checks, formatting. I think this PR is ready to go or be re-reviewed! Thanks!

@mgrachev mgrachev requested a review from a team August 20, 2020 15:40
@baile320 baile320 requested a review from mgrachev August 20, 2020 19:44
@mgrachev mgrachev requested a review from a team August 21, 2020 12:17
mgrachev
mgrachev previously approved these changes Aug 21, 2020
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.

LGTM 👍

@mgrachev mgrachev requested a review from a team August 21, 2020 12:20
@mgrachev mgrachev added this to the v2.2.0 milestone Aug 21, 2020
@mgrachev mgrachev requested a review from a team August 23, 2020 10:55
@mgrachev mgrachev merged commit 538e2be into dotenv-linter:master Aug 26, 2020
@mgrachev
Copy link
Member

@baile320 Thanks a lot! You're awesome! ❤️

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.

Add fixer: LeadingCharacterFixer

3 participants