Commit Graph
216 Commits
Author SHA1 Message Date
dependabot[bot] 183d87a874 Bump github/codeql-action from 4 to 4.37.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4 to 4.37.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4...v4.37.4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.37.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-04 09:43:29 +00:00
John Barton 97a2850142 Merge pull request #265 from joho/ci/pin-windows-2025-vs2026
Point CI to new windows tag
2026-05-25 10:52:27 +10:00
John Barton e77328b146 Update the windows version per github warning.
"NOTICE: windows-latest requests are being redirected to windows-2025-vs2026 by June 15, 2028"
2026-05-25 10:37:27 +10:00
John Barton efa32f116f Merge pull request #264 from joho/fix/allow-hyphens-in-keys
Definitively commit to allowing hyphens (again)
2026-05-25 10:33:10 +10:00
John Barton 139cdfde14 Update readme to capture ruby/node key compatibililty 2026-05-25 10:30:10 +10:00
John Barton 87021fd05a test: drop stale parser-error case for hyphens in keys
PR #245 (commit 82194f2) widened the variable-name charset to include
'-', restoring v1.4.0 behaviour. The "Invalid char" case in
TestParserErrors predates that change and has been failing ever since;
CI only started surfacing it after the recent go.mod bump.

The deliberate "hyphens allowed" contract is already covered by
TestLoadHyphenEnv (positive) and TestKeyNameCharsetRejectsDisallowed
(negative lock-in on '+', '@', '/'), so removing this case is the
correct fix rather than reverting #245.
2026-05-25 10:11:01 +10:00
John Barton 32bfb2c280 Merge pull request #188 from joho/dependabot/github_actions/thatisuday/go-cross-build-1.1.0
Bump thatisuday/go-cross-build from 1.0.2 to 1.1.0
2026-05-20 14:21:31 +10:00
John Barton 17f409325c Bump go mod minimum version 2026-05-20 14:20:46 +10:00
Rohan Verma c92e518f6a tests: add unit tests for parser errors
- Declares errors and wraps them for error checking
by clients
- Adds two unit tests for
  - terminated quote error
  - unexpected char
2026-05-20 14:20:46 +10:00
John Barton 59ad2adcd3 Merge pull request #240 from ignatij/patch-1
docs: add usage for tool dependency in go1.24
2026-05-20 14:19:24 +10:00
John Barton 8680ef74f4 Merge pull request #263 from joho/ci-and-versioning-updates-may-26
CI and Versioning updates
2026-05-20 14:11:22 +10:00
John Barton f5c7006914 Ignore the clanker config while we're at it 2026-05-20 14:10:07 +10:00
John Barton 43a1154afe Update a bunch of actions to latest versions 2026-05-20 14:09:02 +10:00
John Barton 2b82d75077 Update the test matrix & officially supported versions 2026-05-20 14:07:37 +10:00
John Barton eea6c4a3a0 Merge pull request #216 from joho/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2026-05-19 21:56:17 +10:00
John Barton 59c0ac271a Merge pull request #252 from lotusirous/main
simplify Replace(..,-1) by ReplaceAll for strings and bytes
2026-05-19 21:55:59 +10:00
John Barton 045f59bfe5 Merge pull request #254 from guettli/patch-1
Update README to reflect Go version requirement
2026-05-19 21:55:22 +10:00
John Barton 7980d1a6ee Merge pull request #243 from kvokka/patch-1
Fix Precedence & Conventions in README.md
2026-05-19 21:54:49 +10:00
John Barton ffde38feff Merge pull request #198 from ghaninia/bugfix/ParseErrorOnReadme
The `env` variable is already defined but has been declared again
2026-05-19 21:54:18 +10:00
John Barton d1658129f9 Merge branch 'pr-235-merge-prep' 2026-05-19 21:50:28 +10:00
John Barton fecda3c8d4 test: cover +sign and leading-zero preservation in Marshal
Locks in the two data-preservation fixes from #235: values with a
leading + (e.g. phone numbers) and values with leading zeros (e.g.
zero-padded codes) must be quoted on write so they roundtrip
without the strconv.Atoi-style coercion that previously stripped
them.
2026-05-19 21:50:02 +10:00
John Barton 03bb54a6e3 Merge branch 'pr-245-merge-prep' 2026-05-19 16:30:42 +10:00
John Barton 65e5809324 test: lock in variable-name charset after hyphen widening
Adds a negative-test case asserting that '+', '@', and '/' still
return errors after #245 widens the variable-name charset to include
'-'. If a future change widens the charset further, the relevant
case here must be removed on purpose.
2026-05-19 16:29:27 +10:00
John Barton 529bc60899 Merge branch 'fix/escaped-backslash-quote'
fix: don't treat closing quote as escaped after an escaped backslash

The quoted-value terminator loop in extractVarValue treated any
backslash before a quote as an escape, so values ending in an even
number of backslashes (e.g. FOO="bar\\") parsed as "unterminated
quoted value". Replace the single-byte check with a walk-back that
counts the preceding backslash run — escape only when odd.

Closes #225. Does not address #226 (TrimRightFunc stripping a
legitimate escaped quote at the tail of a value) — that's a
separate bug in a different code path.
2026-05-19 15:54:54 +10:00
John Barton f57f0eebf6 Add an extra test coverage for #261 2026-05-19 14:17:09 +10:00
Sai Asish Y b724238db6 fix: don't treat closing quote as escaped after an escaped backslash 2026-05-12 21:37:38 -07:00
Yanhu007 3ec7e17a8d refactor: replace recursion with loop in getStatementStart
Convert the recursive getStatementStart function to an iterative
loop. This prevents potential stack overflow on files with a very
large number of consecutive comment lines.

Ref #232
2026-04-14 14:39:45 +08:00
Thomas Güttler b3d8c45c0f Update README to reflect Go version requirement
Removed instructions for Go versions less than 1.17.
2026-01-07 14:58:49 +01:00
Kha Nguyen 44124b6598 simplify Replace(..,-1) by ReplaceAll for strings and bytes 2025-11-09 10:44:05 +07:00
Parker Brown a2be92d182 Fix typo in hasQuotePrefix return variable (#251)
Corrected the spelling of the return variable from 'isQuored' to 'isQuoted' in the hasQuotePrefix function.
2025-10-22 10:26:18 +11:00
James Wert 82194f2733 Version 1.4.0 allowed hyphen "-" to be in environment variable names, after 1.4.0 this resulted in a parsing error which breaks backwards compatibility. Added back in hyphen support in variable names with associated test cases. 2025-03-31 09:34:30 -04:00
Mikhail Beliakov e1f87cdb6c Fix Precedence & Conventions in README.md 2025-03-11 14:11:04 +00:00
ignatij fab96ba47b docs: add usage for tool dependency in go1.24 2025-02-19 15:25:32 +01:00
柚子uccs 3a7a190201 fix: if a line contains multiple # characters, there will be issues w… (#238)
* fix: if a line contains multiple # characters, there will be issues when traversing from back to front

* fix: typo
v1.6.0-pre.2
2024-12-16 15:14:19 +11:00
Andrey NovikovandStanislau Arsoba a7f6c4c583 Re-add global env variable substitution (#227)
Co-authored-by: Stanislau Arsoba <sarsoba@klika-tech.com>
v1.6.0-pre.1
2024-11-01 09:24:06 +11:00
t3pm14r3 f7b3a6b517 add really big numbers isInt tests 2024-09-03 08:48:01 +03:00
t3pm14r3 bfb9a566c9 add the comment to isInt, run go fmt 2024-09-03 00:23:52 +03:00
t3pm14r3 209910751f replace unicode.IsDigit for number checking 2024-09-02 13:56:44 +03:00
t3pm14r3 2f570db853 fix '-' character trimming and expand the test 2024-09-02 10:54:36 +03:00
t3pm14r3 de05e2d993 got rid of regex, added a check for negative numbers, added a test 2024-09-02 10:42:46 +03:00
t3pm14r3 8e06a029aa fix an int parsing bug in godotenv.Marshal 2024-08-30 22:47:24 +03:00
ALX99 32e64fa834 chore: fix typo (#231) 2024-05-20 16:43:01 +10:00
Kha Nguyen 7765d9d198 Fix panic because of wrong function (#223) 2024-01-13 13:49:45 +11:00
Vintage 383d64cb7e Update cmd.go (#221)
Renuewed Update
2024-01-06 18:10:56 +11:00
dependabot[bot] 805932dc80 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 09:53:28 +00:00
dependabot[bot]andcoop-cloud e3b6eee84d Bump actions/setup-go from 3 to 4 (#207)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-08 12:40:39 +10:00
Chris Jones 193c9aba29 Add whitespace tests. (#210) 2023-04-20 10:52:14 +10:00
John Barton 3fc4292b58 Fix bug where internal unquoted whitespace truncates values (#205)
* Add tests to cover the regression reported in #204

* Add a comment on regex for clarity

* Remove some old code that wasn't doing anything

* Push _all_ parse code into the parser and get tests calling live code

* Add some newline specific tests

* Add some YAML tests for the newline/space split bug

* Fix incorrect terminating of lines on whitespace

* Fix most of the parser regressions

* Bring back FOO.BAR names

* remove some commented out code
v1.5.1
2023-02-06 08:47:38 +11:00
Rakibul Yeasin b311b2657d Fix: ioutil.ReadAll() is deprecated, so removed it's dependency (#202) v1.5.0 2023-02-04 11:10:05 +11:00
2tef 4321598b05 add overload flag (#200)
* add -o flag

increases compatibility with the ruby command

* update README
2023-02-04 11:00:21 +11:00