Skip to content

Option to add debug comments - #226

Merged
jmattheis merged 6 commits into
jmattheis:mainfrom
RangelReale:debug-comments
Jul 19, 2026
Merged

Option to add debug comments#226
jmattheis merged 6 commits into
jmattheis:mainfrom
RangelReale:debug-comments

Conversation

@RangelReale

Copy link
Copy Markdown
Contributor

In some cases we ignore so many fields, it is hard to keep track of what effectivelly was ignored.

This MR adds an options debug:comments [yes | no] which adds comments for each field ignored / skipped.

func (c *ConverterImpl) Convert(source ignore.Input) ignore.Output {
	var exampleOutput ignore.Output
	exampleOutput.Name = source.Name
	// ignored: exampleOutput.Age
	return exampleOutput
}
func (c *ConverterImpl) Convert(source ignoremissing.Input) ignoremissing.Output {
	var exampleOutput ignoremissing.Output
	exampleOutput.Name = source.Name
	// skipped: exampleOutput.Age
	// skipped: exampleOutput.Street
	return exampleOutput
}

Comment thread builder/struct.go Outdated
fieldMapping := ctx.Field(target, targetField.Name())

if fieldMapping.Ignore {
if ctx.Conf.DebugComments {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the PR, I've made some changes.

  • Renamed the setting to annotate:unmapped
  • add comment for unexported ignored fields
  • add docs + tests

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.96%. Comparing base (a7d0f0f) to head (f0c03d2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #226      +/-   ##
==========================================
+ Coverage   95.95%   95.96%   +0.01%     
==========================================
  Files          50       50              
  Lines        2743     2754      +11     
==========================================
+ Hits         2632     2643      +11     
  Misses         80       80              
  Partials       31       31              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jmattheis
jmattheis merged commit 8ee6711 into jmattheis:main Jul 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants