rule :: Rule ParsedShell
rule = simpleRule code severity message check
  where
    code = "DL3028"
    severity = DLWarningC
    message =
      "Pin versions in gem install. Instead of `gem install <gem>` use `gem \
      \install <gem>:<version>`"

    check (Run (RunArgs args _)) = foldArguments (all versionFixed . gems) args
    check _ = True

    versionFixed package = ":" `Text.isInfixOf` package

rule :: Rule ParsedShell
rule = simpleRule code severity message check
  where
    code = "DL3028"
    severity = DLWarningC
    message =
      "Pin versions in gem install. Instead of `gem install <gem>` use `gem \
      \install <gem>:<version>`"

    check (Run (RunArgs args _)) = foldArguments (all versionFixed . gems) args
    check _ = True

    versionFixed package = ":" `Text.isInfixOf` package

rule = simpleRule code severity message check
  where
    code = "DL3028"
    severity = DLWarningC
    message =
      "Pin versions in gem install. Instead of `gem install <gem>` use `gem \
      \install <gem>:<version>`"

    check (Run (RunArgs args _)) = foldArguments (all versionFixed . gems) args
    check _ = True

    versionFixed package = ":" `Text.isInfixOf` package
