<commit_before>- if issues.present?
  .alert.alert-danger
    %p
      %strong
        This deck is not legal in
        = succeed "." do
          = link_to controller: "format", action: "show", id: deck_format.format_name.parameterize do
            = deck_format.format_pretty_name
    %ul
      - issues.each do |kind, *params|
        %li
          - case kind
          - when :banned
            = link_to_card(params.first) do
              = params.first.name
            is banned
          - when :banned_commander
            = link_to_card(params.first) do
              = params.first.name
            is banned as commander
          - when :brawl_basics
            Deck with colorless commander can contain basic lands of only one color
          - when :canlander_points
            - max, points_info = params
            A maximum of #{max} points are allowed but this deck has #{points_info.sum(&:last)} points
            = surround "(", ")" do
              - points_info.each do |card, count, card_points|
                = link_to_card(card) do
                  = card.name
                is
                - if count > 1
                  #{count} ×
                = succeed "." do
                  #{card_points} point#{card_points == 1 ? "" : "s"}
          - when :color_identity
            - card, card_color_identity, deck_color_identity = params
            Deck has a color identity of #{color_identity_name(deck_color_identity)}, but
            = link_to_card(card) do
              = card.name
            has a color identity of #{color_identity_name(card_color_identity)}
          - when :commander
            = link_to_card(params.first) do
              = params.first.name
            is not a valid commander
          - when :commander_sideboard_size
            - actual, sideboard_allowed = params
            - if sideboard_allowed # sideboard allowed, no partners
              Deck's sideboard must be exactly 1 card or 11 cards including the commander, has #{actual}
            - else
              Deck's sideboard must be exactly 1 card or 2 partner cards designated as commander, has #{actual}
          - when :copies
            - card, count, max = params
            Deck contains #{count} copies of
            = succeed "," do
              = link_to_card(card) do
                = card.name
            only up to #{max} allowed
          - when :ech_commander_not_found
            Commander must be in the sideboard, but none of this deck's sideboard cards are legal commanders
          - when :ech_too_many_commanders
            A deck can only have one commander, but this deck has #{params.first} (support for legendary creatures in the wishboard coming soon™)
          - when :fdh_commander
            Commanders must be custom cards, but #{params.first.name} is an official card
          - when :fdh_custom_quota
            - actual, expected = params
            Main deck must contain at least #{expected} custom nonland cards, has #{actual}
          - when :main_size
            - actual, expected = params
            Mainboard must contain exactly #{expected} cards, has #{actual}
          - when :main_size_min
            - actual, expected = params
            Deck must contain at least #{expected} mainboard cards, has only #{actual}
          - when :not_in_format
            = link_to_card(params.first) do
              = params.first.name
            is not in the format
          - when :not_in_game
            - game, card = params
            = link_to_card(card) do
              = card.name
            - if game == "paper"
              is not available as a paper card
            - else
              is not available on #{game}
          - when :not_on_xmage
            = link_to_card(params.first) do
              = params.first.name
            is not yet implemented in XMage
            %span.cardinfo
              - xc = exh_card(params.first)
              - votes = xc.voter_ids.size
              = link_to({controller: "xmage", action: "vote", name: xc.name}, class: "legality-banned") do
                %i{class: (signed_in? && xc.voters.include?(current_user)) ? "voted" : ""}
                  #{votes} vote#{votes == 1 ? "" : "s"}
          - when :partner
            = link_to_card(params.first) do
              = params.first.name
            is not a valid partner card
          - when :partner_with
            - a, b = params
            = link_to_card(a) do
              = a.name
            can only partner with
            = succeed "," do
              = link_to_card(a.partner) do
                = a.partner.name
            not with
            = link_to_card(b) do
              = b.name
          - when :side_size_max
            - actual, expected = params
            Deck must contain at most #{expected} sideboard cards, has #{actual}
          - when :size
            - actual, expected = params
            Deck must contain exactly #{expected} cards, has #{actual}
          - when :unknown_card
            - if params.first.is_a?(OutdatedCard)
              Card #{params.first.name} is from
              = link_to_set(params.first.set) do
                = params.first.set.name
              version #{params.first.set_version}, but the current version is #{params.first.set.custom_version}.
            - else
              Unknown card name: #{params.first.name}
          - when :unknown_game
            Unknown game: #{params.first}
          - when :unknown_legality
            - card, card_legality = params
            Unknown legality #{card_legality} for
            = link_to_card(card) do
              = card.name
          - else
            Unknown deck issue: #{kind}
- else
  .row
    .col-12.warnings
      .warning
        This deck is
        = link_to controller: "format", action: "show", id: deck_format.format_name.parameterize do
          = deck_format.format_pretty_name
        legal.
<commit_msg>Remove period from new error message for consistency<commit_after>- if issues.present?
  .alert.alert-danger
    %p
      %strong
        This deck is not legal in
        = succeed "." do
          = link_to controller: "format", action: "show", id: deck_format.format_name.parameterize do
            = deck_format.format_pretty_name
    %ul
      - issues.each do |kind, *params|
        %li
          - case kind
          - when :banned
            = link_to_card(params.first) do
              = params.first.name
            is banned
          - when :banned_commander
            = link_to_card(params.first) do
              = params.first.name
            is banned as commander
          - when :brawl_basics
            Deck with colorless commander can contain basic lands of only one color
          - when :canlander_points
            - max, points_info = params
            A maximum of #{max} points are allowed but this deck has #{points_info.sum(&:last)} points
            = surround "(", ")" do
              - points_info.each do |card, count, card_points|
                = link_to_card(card) do
                  = card.name
                is
                - if count > 1
                  #{count} ×
                = succeed "." do
                  #{card_points} point#{card_points == 1 ? "" : "s"}
          - when :color_identity
            - card, card_color_identity, deck_color_identity = params
            Deck has a color identity of #{color_identity_name(deck_color_identity)}, but
            = link_to_card(card) do
              = card.name
            has a color identity of #{color_identity_name(card_color_identity)}
          - when :commander
            = link_to_card(params.first) do
              = params.first.name
            is not a valid commander
          - when :commander_sideboard_size
            - actual, sideboard_allowed = params
            - if sideboard_allowed # sideboard allowed, no partners
              Deck's sideboard must be exactly 1 card or 11 cards including the commander, has #{actual}
            - else
              Deck's sideboard must be exactly 1 card or 2 partner cards designated as commander, has #{actual}
          - when :copies
            - card, count, max = params
            Deck contains #{count} copies of
            = succeed "," do
              = link_to_card(card) do
                = card.name
            only up to #{max} allowed
          - when :ech_commander_not_found
            Commander must be in the sideboard, but none of this deck's sideboard cards are legal commanders
          - when :ech_too_many_commanders
            A deck can only have one commander, but this deck has #{params.first} (support for legendary creatures in the wishboard coming soon™)
          - when :fdh_commander
            Commanders must be custom cards, but #{params.first.name} is an official card
          - when :fdh_custom_quota
            - actual, expected = params
            Main deck must contain at least #{expected} custom nonland cards, has #{actual}
          - when :main_size
            - actual, expected = params
            Mainboard must contain exactly #{expected} cards, has #{actual}
          - when :main_size_min
            - actual, expected = params
            Deck must contain at least #{expected} mainboard cards, has only #{actual}
          - when :not_in_format
            = link_to_card(params.first) do
              = params.first.name
            is not in the format
          - when :not_in_game
            - game, card = params
            = link_to_card(card) do
              = card.name
            - if game == "paper"
              is not available as a paper card
            - else
              is not available on #{game}
          - when :not_on_xmage
            = link_to_card(params.first) do
              = params.first.name
            is not yet implemented in XMage
            %span.cardinfo
              - xc = exh_card(params.first)
              - votes = xc.voter_ids.size
              = link_to({controller: "xmage", action: "vote", name: xc.name}, class: "legality-banned") do
                %i{class: (signed_in? && xc.voters.include?(current_user)) ? "voted" : ""}
                  #{votes} vote#{votes == 1 ? "" : "s"}
          - when :partner
            = link_to_card(params.first) do
              = params.first.name
            is not a valid partner card
          - when :partner_with
            - a, b = params
            = link_to_card(a) do
              = a.name
            can only partner with
            = succeed "," do
              = link_to_card(a.partner) do
                = a.partner.name
            not with
            = link_to_card(b) do
              = b.name
          - when :side_size_max
            - actual, expected = params
            Deck must contain at most #{expected} sideboard cards, has #{actual}
          - when :size
            - actual, expected = params
            Deck must contain exactly #{expected} cards, has #{actual}
          - when :unknown_card
            - if params.first.is_a?(OutdatedCard)
              Card #{params.first.name} is from
              = link_to_set(params.first.set) do
                = params.first.set.name
              version #{params.first.set_version}, but the current version is #{params.first.set.custom_version}
            - else
              Unknown card name: #{params.first.name}
          - when :unknown_game
            Unknown game: #{params.first}
          - when :unknown_legality
            - card, card_legality = params
            Unknown legality #{card_legality} for
            = link_to_card(card) do
              = card.name
          - else
            Unknown deck issue: #{kind}
- else
  .row
    .col-12.warnings
      .warning
        This deck is
        = link_to controller: "format", action: "show", id: deck_format.format_name.parameterize do
          = deck_format.format_pretty_name
        legal.

{'fraction_non_alphanumeric': 0.08233433233433234, 'fraction_numerical': 0.001665001665001665, 'mean_word_length': 1.5381364884851045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '661070', 'n_tokens_mistral': 3204, 'n_tokens_neox': 3141, 'n_words': 985}