Skip to content

Conversation

@jkeuhlen
Copy link
Contributor

@jkeuhlen jkeuhlen commented Apr 7, 2025

This is my first Go PR ever so let me know if I doing something silly.

This should resolve #17

}

// TestExcludeFlag tests that the exclude flag properly excludes tables from export
func TestExcludeFlag(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

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

I think the existing runExportTestData implicitly does a lot of similar checks by comparing to the expectedRipoffFile, you could alternatively modify that function to check for the existence of an optional file like exclude.yml which contains an array of tables to exclude, then create a new dir in testdata/export that matches what you're doing now.

Comment on lines +125 to +135
// stringSliceFlag is a custom flag to support multiple --exclude flags
type stringSliceFlag []string

func (s *stringSliceFlag) String() string {
return fmt.Sprintf("%v", *s)
}

func (s *stringSliceFlag) Set(value string) error {
*s = append(*s, value)
return nil
}
Copy link
Owner

Choose a reason for hiding this comment

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

Cool, I've never done a custom flag.Value before

@mortenson mortenson merged commit 7086a1a into mortenson:main Apr 14, 2025
2 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.

Allow excluding tables from generation in ripoff-export

2 participants