-
Notifications
You must be signed in to change notification settings - Fork 513
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
Scalafix: Add Avro coder import for SpecificRecord JobTest IOs #5237
Conversation
@@ -128,6 +133,19 @@ class FixAvroCoder extends SemanticRule("FixAvroCoder") { | |||
// Coder[T] is a variable type where T is an avro type | |||
findMatchingValTypeParams(t, CoderMatcher) | |||
.exists(isAvroType) | |||
case q"$jobTestBuilder(..$args)" if JobTestBuilderMatcher.matches(jobTestBuilder) => |
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.
I spent some time trying to make this generic, so that it would match any function with an implicit coder evidence T
, by inspecting each function argument for one that matched type T
, but it got pretty complex/edge-casey. Not sure it's worth it
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5237 +/- ##
==========================================
- Coverage 62.64% 62.63% -0.01%
==========================================
Files 301 301
Lines 10849 10849
Branches 745 745
==========================================
- Hits 6796 6795 -1
- Misses 4053 4054 +1 ☔ View full report in Codecov by Sentry. |
case importer"com.spotify.scio.avro.{..$imps}" => | ||
imps.map(i => Patch.removeImportee(i) + Patch.addGlobalImport(avroImport)).asPatch |
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.
This may have an impact on import alias, but I think this is still worth it
No description provided.