Skip to content
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

0213 multiline string indentation #284

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Feb 13, 2024

now we can do this:

a {
  b {
    c = """~
      line1

      line2

      line3
    ~"""
  }
}

More practical examples:

rule_engine {
  ignore_sys_message = true
  jq_function_default_timeout = 10s
  rules {
    a_WH_D {
      actions = ["http:a_WH_D"]
      description = ""
      enable = true
      metadata {created_at = 1707562385536}
      name = ""
      sql = """~
        SELECT
          *
        FROM
          "#",
          "$events/message_delivered",
          "$events/message_acked",
          "$events/message_dropped",
          "$events/client_connected",
          "$events/client_disconnected",
          "$events/client_connack",
          "$events/client_check_authz_complete",
          "$events/session_subscribed",
          "$events/session_unsubscribed",
          "$events/delivery_dropped"~"""
    }
    rule_rc0w {
      actions = [
        {
          args {
            mqtt_properties {}
            payload = "${.}"
            qos = 0
            retain = false
            topic = "republish-event/${clientid}"
            user_properties = ""
          }
          function = republish
        },
        {function = console}
      ]
      enable = true
      metadata {created_at = 1707389712653}
      name = ""
      sql = """~
        SELECT
          *
        FROM
          "$events/client_connected",
          "$events/client_disconnected"
      ~"""
    }
    rule_xlu4 {
      actions = [
        {function = console}
      ]
      description = ""
      enable = true
      metadata {created_at = 1706611936022}
      name = ""
      sql = """~
        SELECT
          *
        FROM
          "t/#"
      ~"""
    }
  }
}

@zmstone zmstone requested a review from a team February 13, 2024 13:06
@zmstone zmstone force-pushed the 0213-multiline-string-indentation branch from e4f75a8 to bb0fca0 Compare February 13, 2024 13:57
@zmstone zmstone force-pushed the 0213-multiline-string-indentation branch from bb0fca0 to 35068cb Compare February 13, 2024 13:59
@zmstone zmstone force-pushed the 0213-multiline-string-indentation branch from be80363 to 0d0c736 Compare February 13, 2024 14:25
@zmstone zmstone merged commit 98cd69a into emqx:master Feb 13, 2024
3 checks passed
@zmstone zmstone deleted the 0213-multiline-string-indentation branch February 13, 2024 21:01
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.

2 participants