-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Add debug message if no encoding is specified #735
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If no encoding is specified in the options, debug will alert the user that UTF-8 will be used as the default. Closes motdotla#657
This is a reasonable approach, but what we are going to do instead is add a It will output a lot of helpful text if you are:
|
motdotla
force-pushed
the
master
branch
4 times, most recently
from
May 30, 2023 16:15
01fa9ef
to
ef48935
Compare
we started moving the more detailed information mentioned above into but this is still a great and quick addition. will release as part of next release for dotenv |
Vylpes
pushed a commit
to Vylpes/card-drop
that referenced
this pull request
Jan 22, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dotenv](https://github.com/motdotla/dotenv) | dependencies | patch | [`16.3.1` -> `16.3.2`](https://renovatebot.com/diffs/npm/dotenv/16.3.1/16.3.2) | --- ### Release Notes <details> <summary>motdotla/dotenv (dotenv)</summary> ### [`v16.3.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1632-2024-01-18) [Compare Source](motdotla/dotenv@v16.3.1...v16.3.2) ##### Added - Add debug message when no encoding set [#​735](motdotla/dotenv#735) ##### Changed - Fix output typing for `populate` [#​792](motdotla/dotenv#792) - Use subarray instead of slice [#​793](motdotla/dotenv#793) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/149 Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
Vylpes
pushed a commit
to Vylpes/vylbot-app
that referenced
this pull request
Jan 31, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dotenv](https://github.com/motdotla/dotenv) | dependencies | minor | [`16.3.1` -> `16.4.1`](https://renovatebot.com/diffs/npm/dotenv/16.3.1/16.4.1) | --- ### Release Notes <details> <summary>motdotla/dotenv (dotenv)</summary> ### [`v16.4.1`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1641-2024-01-24) [Compare Source](motdotla/dotenv@v16.4.0...v16.4.1) - Patch support for array as `path` option [#​797](motdotla/dotenv#797) ### [`v16.4.0`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1640-2024-01-23) [Compare Source](motdotla/dotenv@v16.3.2...v16.4.0) - Add `error.code` to error messages around `.env.vault` decryption handling [#​795](motdotla/dotenv#795) - Add ability to find `.env.vault` file when filename(s) passed as an array [#​784](motdotla/dotenv#784) ### [`v16.3.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1632-2024-01-18) [Compare Source](motdotla/dotenv@v16.3.1...v16.3.2) ##### Added - Add debug message when no encoding set [#​735](motdotla/dotenv#735) ##### Changed - Fix output typing for `populate` [#​792](motdotla/dotenv#792) - Use subarray instead of slice [#​793](motdotla/dotenv#793) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/397 Reviewed-by: Vylpes <ethan@vylpes.com> Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
Vylpes
pushed a commit
to Vylpes/Droplet
that referenced
this pull request
Feb 5, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dotenv](https://github.com/motdotla/dotenv) | dependencies | minor | [`16.3.1` -> `16.4.1`](https://renovatebot.com/diffs/npm/dotenv/16.3.1/16.4.1) | --- ### Release Notes <details> <summary>motdotla/dotenv (dotenv)</summary> ### [`v16.4.1`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1641-2024-01-24) [Compare Source](motdotla/dotenv@v16.4.0...v16.4.1) - Patch support for array as `path` option [#​797](motdotla/dotenv#797) ### [`v16.4.0`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1640-2024-01-23) [Compare Source](motdotla/dotenv@v16.3.2...v16.4.0) - Add `error.code` to error messages around `.env.vault` decryption handling [#​795](motdotla/dotenv#795) - Add ability to find `.env.vault` file when filename(s) passed as an array [#​784](motdotla/dotenv#784) ### [`v16.3.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1632-2024-01-18) [Compare Source](motdotla/dotenv@v16.3.1...v16.3.2) ##### Added - Add debug message when no encoding set [#​735](motdotla/dotenv#735) ##### Changed - Fix output typing for `populate` [#​792](motdotla/dotenv#792) - Use subarray instead of slice [#​793](motdotla/dotenv#793) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/Droplet/pulls/261 Reviewed-by: Vylpes <ethan@vylpes.com> Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If no encoding is specified in the options, debug will alert the user that UTF-8 will be used as the default.
From my perspective, there were two resolutions to this issue.
While UTF-8 is one of the few encodings that can be reliably validated without using heuristics, the code to do so is generally not compact or easy to understand, and would require running the validation function on the entire string, in addition to being parsed.
The original issue this fix stems from was a mismatched encoding for .dotenv not conforming with the default UTF-8 (UTF-16-LE was the culprit). Implementing an entire UTF-8 validator function seems to be overkill (both computationally, and code clarity wise) for, from what I can tell, is not a common issue. I think alerting the user of the default encoding only in debug mode is a good compromise to avoid unnecessary bloat.
Please let me know your thoughts. This is my first open source contribution, so any and all critique is welcome.
Thank you! :)
Closes #657