FixYourWorkaround.jl -- Remind yourself to fix your workarounds

Introducing FixYourWorkaround.jl, a small testing utility package to remind you to fix your package dependency workarounds.

Motivation behind this package comes from having to support multiple versions of a dependency and creating some workarounds for it. A real world example of this is with DataFrames@0.20 and avoiding broadcasting.

Replacing the following:

for (df, foo) in zip(data_frames, foo)
    df[!, :foo] .= foo
end

With:

for (df, foo) in zip(data_frames, foo)
    df[!, :foo] = fill(foo, nrow(df))
end

In a later date when DataFrames@0.20 is dropped we want to revert this change, however how do we remember to make this change? Sure we can leave a TODO and create a Git Issue for it, but that still banks on people needing to look for TODOs in the repository, or remembering the issue exists.

This is where FixYourWorkaround.jl comes in, all you need to do is create a test case which will check if you no longer support a version of a package dependency. In the example above you would just need to add in:

using FixYourWorkaround

# Link to the Git issue
@test package_compatible("DataFrames", "0.20")

When support for DataFrames@0.20 is removed, the test will fail. Thus, reminding you to fix your workaround!

13 Likes