GithubHelp home page GithubHelp logo

jsonlint's People

Contributors

dougbarth avatar lacostenycoder avatar mburns avatar olleolleolle avatar ranjib avatar shortdudey123 avatar viraptor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jsonlint's Issues

DEPRECATION warning from trollop dependency

When running jsonlint from the command line, it throws:

[DEPRECATION] This gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible.

I suppose it means to use https://github.com/ManageIQ/optimist

I tested each of these dependencies and just simply require 'trollop' gave the deprecation warning.

gem dependency jsonlint
Gem jsonlint-0.2.0
  aruba (>= 0, development)
  bundler (~> 1.6, development)
  oj (~> 2)
  rake (>= 0, development)
  rspec (>= 0, development)
  trollop (~> 2)

Support input steams

I see this is supported in master branch, looking forward to input validation via Linter class for usage outside of CLI.

For now I am installing gem via git ref as a work around. Example

example

a = JsonLint::Linter.new
a.check_stream StringIO.new '{"a"}'
a.errors
=> {""=>["expected colon, not a hash close at line 1, column 5 [parse.c:549]"]}

It would be nice to just pass in my json string (not necessarily of the IO class, just a string), so I do not have to worry about the #read method - the errors appear to be strangely formatted as well, in this case, blank string is key.

Use a single pass through the JSON document

Right now the code is doing two passes through the JSON document. First to see if it is parseable and then second to find overlapping keys.

The streaming callback API seems to have enough information to support both checks. This code should be refactored to do all linting in single pass. Perhaps with some sort of streaming event multiplexer so all the logic isn't mixed up together.

Usage output

Running jsonlint with no args doesn't print any usage output. This should be fixed up.

JSON is too deeply nested (SystemStackError)

I am having an issue and I can only reproduce it in my jenkins instance so I assume its something that is related to the system, ruby, and gems installed. Here is the relevant output from my jenkins job with some extra information such as ruby version and gems added for debug purposes.

https://gist.github.com/majormoses/721d610a1a11c0ffde9e1a1aa594cba1

Here is the simple json that was used to test:
https://gist.github.com/majormoses/e3245bf85ec2b1d1248ea2159f6b11f0

Any useful insight as where to look would be greatly appreciated.

Allow recursion over directories

When the user supplies a filename which is a directory, automatically perform jsonlint'ing of the directory contents, recursively.

Better error output for parse errors

Oj's output for parsing errors is kind of sparse. It would be nice to show a snippet of the JSON and point to the exact spot where the error occurred.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.