Skip to content
Zachary Moore edited this page Jan 14, 2019 · 2 revisions

JSONCustomLintr

Library for the creation, running, and reporting of Custom Lint Rules for files that follow JSON Notation.

Motivation

The primary motivation for creating the library is for creating linting rules for avro schemas in an API environment.

Introducing a tool to allow developers to lint JSON helps to:

  • Introduce a style safeguard to structured data schemas
  • Scale an API across multiple devs without having to worry about inconsistencies
  • Allow more hands off development and less monitoring of style conventions
  • Introduce rules to allow for more advanced codegen / client freedom by disallowing patterns that would clash with either

Features

JsonLint leverages JSON-java to generate Java objects from JSON files.
This allows us to retain all the information we get from the library while also wrapping to provide more context to the object when creating linting rules.

Features of the library include:

  • Programmatic creation of lint rules
  • Configurable number of lint rules to be run
  • Configurable level of lint severity
  • Running of lint rules on a single file or all files in a directory
  • Running of lint rules on any JSON format regardless of the file extension
  • HTML report summary of all lint warnings / errors
Clone this wiki locally