Giter Club home page Giter Club logo

Comments (3)

schlessera avatar schlessera commented on July 28, 2024 1

I've already helped build a similar thing here: https://github.com/fklein-lu/checker-cli/tree/master/src

Basically, it is a generalized pipeline running one or more Checks, and each Check can add issues to a container, like shown here: https://github.com/fklein-lu/checker-cli/blob/master/src/Check/RequiredFilesCheck.php#L34-L42

The Issues contain all the data that is needed for recording problems. Also, they know how to render themselves into text or JSON: https://github.com/fklein-lu/checker-cli/blob/master/src/Issue.php#L76-L101

With this object model, you can easily write multiple ReportGenerators, which could be used for providing different --format=<format> implementations: https://github.com/fklein-lu/checker-cli/tree/master/src/Report

from i18n-command.

swissspidy avatar swissspidy commented on July 28, 2024

I'm wondering what the best way would be to get these warnings (and other errors) in a machine-readable manner.

Use case: we currently programmatically extract strings from our projects after each push to GitHub and import them into GlotPress. On success, we send a notification to our Slack channel. Now I want to do the same for errors as well.

Do I need to parse the terminal output using regex, or hold the messages in MakePotCommand and print them at the end in the desired format, or is there a better way?

Many commands have a --format argument, but AFAIK this is only used to print things like objects or lists in a specific format, not error messages.

@schlessera Would love to hear your insights on this :-)

from i18n-command.

swissspidy avatar swissspidy commented on July 28, 2024

Very helpful, thanks!

Will try to explore this concept a bit for the make-pot command so we could eventually add a --format argument to it.

In the mean time I guess we'll resort to parsing the output on our own in our script.

from i18n-command.

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.