{"record":{"id":"c9245d431f053372","repo":"puppetlabs/puppet","slug":"the-format-fmt-is-not-a-valid-format-on-the-f","errorCode":null,"errorMessage":"The format '#{fmt}' is not a valid format on the form '%<flags><width>.<prec><format>'","messagePattern":"The format '#(.+?)' is not a valid format on the form '%<flags><width>\\.<prec><format>'","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/types/string_converter.rb","lineNumber":106,"sourceCode":"    attr_reader :orig_fmt\n\n    FMT_PATTERN_STR = '^%([\\s\\[+#0{<(|-]*)([1-9][0-9]*)?(?:\\.([0-9]+))?([a-zA-Z])$'\n    FMT_PATTERN = Regexp.compile(FMT_PATTERN_STR)\n    DELIMITERS  = ['[', '{', '(', '<', '|']\n    DELIMITER_MAP = {\n      '[' => ['[', ']'],\n      '{' => ['{', '}'],\n      '(' => ['(', ')'],\n      '<' => ['<', '>'],\n      '|' => ['|', '|'],\n      :space => ['', '']\n    }.freeze\n\n    def initialize(fmt)\n      @orig_fmt = fmt\n      match = FMT_PATTERN.match(fmt)\n      unless match\n        raise ArgumentError, \"The format '#{fmt}' is not a valid format on the form '%<flags><width>.<prec><format>'\"\n      end\n\n      @format = match[4]\n      unless @format.is_a?(String) && @format.length == 1\n        raise ArgumentError, \"The format must be a one letter format specifier, got '#{@format}'\"\n      end\n\n      @format = @format.to_sym\n      flags  = match[1].split('') || []\n      unless flags.uniq.size == flags.size\n        raise ArgumentError, \"The same flag can only be used once, got '#{fmt}'\"\n      end\n\n      @left  = flags.include?('-')\n      @alt   = flags.include?('#')\n      @plus  = if flags.include?(' ')\n                 :space\n               else","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/types/string_converter.rb#L88-L124","documentation":"Error \"The format '#{fmt}' is not a valid format on the form '%<flags><width>.<prec><format>'\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/types/string_converter.rb:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}