{"record":{"id":"68cd70d6157d6b7e","repo":"Shopify/liquid","slug":"rigid-is-deprecated-use-strict2-instead","errorCode":null,"errorMessage":":rigid is deprecated. Use :strict2 instead.","messagePattern":":rigid is deprecated\\. Use :strict2 instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/liquid/parser_switching.rb","lineNumber":55,"sourceCode":"      when :lax     then lax_parse(markup)\n      when :warn\n        begin\n          strict2_parse_with_error_context(markup)\n        rescue SyntaxError => e\n          parse_context.warnings << e\n          lax_parse(markup)\n        end\n      end\n    end\n\n    def strict2_mode?\n      parse_context.error_mode == :strict2 || parse_context.error_mode == :rigid\n    end\n\n    private\n\n    def rigid_warn\n      Deprecations.warn(':rigid', ':strict2')\n    end\n\n    def strict2_parse_with_error_context(markup)\n      strict2_parse(markup)\n    rescue SyntaxError => e\n      e.line_number    = line_number\n      e.markup_context = markup_context(markup)\n      raise e\n    end\n\n    def strict_parse_with_error_context(markup)\n      strict_parse(markup)\n    rescue SyntaxError => e\n      e.line_number    = line_number\n      e.markup_context = markup_context(markup)\n      raise e\n    end\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/Shopify/liquid/blob/807d45a6b3d4568e64e86b375e3702df2c7c860c/lib/liquid/parser_switching.rb#L37-L73","documentation":"Using the :rigid error mode triggers a deprecation notice via Deprecations.warn: :rigid was renamed to :strict2, which enforces correct syntax for all tags. Behavior is identical; only the name changed, and :rigid will eventually be removed.","triggerScenarios":"Setting error_mode: :rigid in Template.parse options, an Environment, or a parse_context used by parser-switching tags.","commonSituations":"Code copied from Liquid forks/older Shopify branches that used :rigid; config DSLs that expose error mode strings from user input.","solutions":["Replace :rigid with :strict2 wherever error_mode is set","Validate user-supplied error modes against the canonical set [:lax, :warn, :strict, :strict2]"],"exampleFix":"// before\nLiquid::Template.parse(src, error_mode: :rigid)\n// after\nLiquid::Template.parse(src, error_mode: :strict2)","handlingStrategy":"validation","validationCode":"VALID_MODES = %i[lax warn strict strict2].freeze\nraise ArgumentError, \"bad error_mode #{mode}\" unless VALID_MODES.include?(mode)","typeGuard":"def valid_error_mode?(m) %i[lax warn strict strict2].include?(m.to_s.to_sym) end","tryCatchPattern":null,"preventionTips":["Use :strict2 instead of the :rigid alias everywhere","Whitelist error modes when exposing them via config/ENV","Grep for ':rigid' in app and dependency code during upgrades"],"tags":["ruby","liquid","deprecation","parser"],"backgroundTag":"deprecated-api-usage","analyzedSha":"807d45a6b3d4568e64e86b375e3702df2c7c860c","analyzedAt":"2026-09-08T11:31:38.917Z","contentChangedAt":"2026-09-08T11:31:38.917Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}