Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 454 Bytes

json_check.md

File metadata and controls

19 lines (16 loc) · 454 Bytes

JSON check API

For checking the content of .json files.

module ThemeCheck
  class MyCheckName < JsonCheck
    category :json,
    # A check can belong to multiple categories. Valid ones:
    categories :translation, :performance
    severity :suggestion # :error or :style

    def on_file(file)
      file # an instance of `ThemeCheck::JsonFile`
      file.content # the parsed JSON, as a Ruby object, usually a Hash
    end
  end
end