-
Notifications
You must be signed in to change notification settings - Fork 35
Add cases for non-compliant struct tag and remove go vet check from CI and Makefile
#158
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds test cases to verify that the YAML library correctly handles and round-trips struct fields with non-standard tag syntax (bare strings without the yaml: prefix) alongside standard yaml: tags, addressing issue #157.
- Adds marshal test case for structs with mixed standard and non-standard tag formats
- Adds unmarshal test case for structs with mixed standard and non-standard tag formats
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| encode_test.go | Adds test case verifying marshaling behavior with non-compliant struct tags |
| decode_test.go | Adds test case verifying unmarshaling behavior with non-compliant struct tags |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5fb6764 to
aa9ef1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aa9ef1e to
f8260bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ccoVeille
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
Please remove the go vet jobs from GHA and the govet in Makefile entry
You might also have to update go test calls use -vet=off as flags with GHA and Makefile, the govet linters in golangci-lint is enough and supports //nolint:govet as you said.
About this ☝️ It reminds me your comment in the other issue 👇
I'm unsure how you got no errors as using go test uses go vet by default with Go 1.24+ |
|
I don't know, 25-10-28 14:25 % go test ./...
ok go.yaml.in/yaml/v4 2.087s
? go.yaml.in/yaml/v4/cmd/go-yaml [no test files]
? go.yaml.in/yaml/v4/internal/libyaml [no test files]
ok go.yaml.in/yaml/v4/internal/testutil/assert 0.615s
ok go.yaml.in/yaml/v4/yts 1.099s
25-10-28 14:25 % go version
go version go1.24.9 darwin/arm64Okay, I checked the documentation for
Seems this particular check is disabled for test cmd. The |
f8260bf to
51308ab
Compare
|
I got an idea, maybe instead of removing |
|
You could indeed this could do the job
But, I'm unsure here. At least you would only have it in makefile and not the GHA. I would simply remove it. But it doesn't mean I'm right about it. I get your point, I'm unsure what is the best. As If it is removed, there might be a need to update contributions guide. Also, please consider adding |
|
Looks like the the |
sure, will add |
fb63ecc to
a75392c
Compare
Indeed #131 is not merged yet. |
go vet check from CI and Makefile
a75392c to
87bb065
Compare
|
@ccoVeille @ingydotnet I rebased this PR and I think it is ready |
@SVilgelm thanks. I'm out of tuits for this until at least Friday... |
a56f255 to
dd1e8c5
Compare
2f01b53 to
e25e558
Compare
0750bdf to
ce640e4
Compare
Add test cases to decode_test.go and encode_test.go that cover an edge case described in issue yaml#157 where a struct field uses an incorrect tag syntax (a bare string like `bar` without the `yaml:` prefix) alongside a correct `yaml:"foo"` tag. The new tests assert that the library continues to accept and round-trip values when one field uses the supported-but-nonstandard tag form. This clarifies expected behavior and prevents regressions for legacy struct tags that some users rely on.
Remove the redundant go vet invocation from both the GitHub Actions workflow and the GNUmakefile. The CI workflow no longer runs "go vet ./..." and the "vet" target and its invocation in the makefile are deleted. This simplifies the build steps and avoids running go vet twice or as a separate target, keeping linting/formatting tasks consolidated (e.g. golangci-lint).
Disable the Go vet tool when running test and helper commands to avoid vet-related failures blocking test execution. Update the main test target so its result parsing is not affected by vet output. This prevents vet output from being treated as test output and keeps CI and local test runs stable when vet reports issues that should not fail the test invocation.
Co-authored-by: ccoVeille <[email protected]> Apply suggestion from @ccoVeille Co-authored-by: ccoVeille <[email protected]>
ce640e4 to
fa651e9
Compare
Update the lint rule in the GNUmakefile to invoke the linting target with a package pattern instead of running the default subcommand and remove the separate fumpt installation and format step. The lint recipe now runs "$< run ./..." which ensures golangci-lint (or the versioned linter) processes all packages in the repository. Removing the fumpt-specific lines avoids installing gofumpt during the Make process and relies on the linter or other tooling to handle formatting, simplifying and speeding up the Makefile workflow.
|
Let's merge and continue with other PR. It's a test we add and some addition to makefile |
Add test cases to decode_test.go and encode_test.go that cover an edge case described in issue #157 where a struct field uses an incorrect tag syntax (a bare string like
barwithout theyaml:prefix) alongside a correctyaml:"foo"tag. The new tests assert that the library continues to accept and round-trip values when one field uses the supported-but-nonstandard tag form.This clarifies expected behavior and prevents regressions for legacy struct tags that some users rely on.
Remove the redundant go vet invocation from both the GitHub Actions
workflow and the GNUmakefile. The CI workflow no longer runs
"go vet ./..." and the "vet" target and its invocation in the makefile
are deleted.
Disable the Go vet tool when running test and helper commands
to avoid vet-related failures blocking test execution. Update the main
test target so its result parsing is not affected by vet output.
Fixes #157