Giter Club home page Giter Club logo

Comments (8)

sirosen avatar sirosen commented on June 6, 2024 2

Sorry, did I say the next couple of hours? I meant minutes! 😅
(The fix and testing for it came together surprisingly easily.)

v0.18.2 is now available with the fix. Please give it a go and let me know if it still isn't working for any reason!

from check-jsonschema.

FWest98 avatar FWest98 commented on June 6, 2024 1

Works perfectly fine! Thanks so much for the quick replies, this is the most usable tool of all yaml/json linters/checkers for use in a git hook.

from check-jsonschema.

sirosen avatar sirosen commented on June 6, 2024

That sounds like a reasonable use-case and a good improvement to the behavior! Consider this "accepted" -- I'll try to find time to work on this.

from check-jsonschema.

sirosen avatar sirosen commented on June 6, 2024

I've just released v0.18.0, which changes the way that parsing errors are handled to accommodate this.
The error output has changed slightly, and it should no longer stop processing when a file fails to parse.

I hope this works well for you. Let me know if you run into issues with it!

from check-jsonschema.

FWest98 avatar FWest98 commented on June 6, 2024

Thank you so much! It works very well for JSON, but invalid YAML files still crash the tool, unfortunately. They crash with a ScannerError, which seems like is not being caught in the code yet.

from check-jsonschema.

sirosen avatar sirosen commented on June 6, 2024

Can you provide me with a sample YAML file which crashes things in this way? I tested against YAML and other formats, so it's supposed to work, but I guess I'm missing some case(s).

from check-jsonschema.

FWest98 avatar FWest98 commented on June 6, 2024

For example:

foo: bar
invalid

from check-jsonschema.

sirosen avatar sirosen commented on June 6, 2024

Thanks for the example! I'm able to reproduce and I see the cause.

The current code catches ruamel.yaml.ParserError, but that only refers to errors during the parse phase of YAML loading. The above produces a ScannerError (IIRC "scanning" is tokenization/lexing).
I should probably broaden the error class to the base YAMLError. I expect to have a fix done, tested, and released within the next couple of hours.

from check-jsonschema.

Related Issues (20)

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.