Giter Club home page Giter Club logo

Comments (4)

premek avatar premek commented on June 6, 2024

I think luaunit does something like that
https://github.com/bluebird75/luaunit/blob/master/luaunit.lua#L852

from inspect.lua.

kikito avatar kikito commented on June 6, 2024

Hi there,

I am not opposed to something like this, but I don't think I would activate it by default. It could be done by adding an extra option in the options param. Or maybe making the options.newline option accept a function with some parameters to decide this kind of thing.

I gave a quick look at luaunit and it wasn't clear to me that the keeponeline variable worked as you say. It seems to me you must choose between "all in one line" (keeponeline=true) or "all elements in a new line, even the short ones" (keeponeline=false). There doesn't seem to be a way to "automatically deciding whether to keep things in one line or not depending on their length'.

What do you think? Would you consider making a pull request for this?

from inspect.lua.

premek avatar premek commented on June 6, 2024

I also had just a quick look to luaunit source, I'm not sure if the line I linked is the correct one, but luaunit works that way. This is some output form luaunit:

[...]
    {
        "knot",
        "dragged_outside",
        {"para", "He insisted that we hurried home to Savile Row"},
        {"divert", "as_fast_as_we_could"}
    },
    {"knot", "as_fast_as_we_could", "glue", {"para", "as fast as we could."}}

Two objects, both have strings and objects inside, first one is multiline, second one is one-line.

I may try to do a pull request if I find some time, thanks :)

from inspect.lua.

kikito avatar kikito commented on June 6, 2024

Closing this for now, but feel free to send a PR if you want!

from inspect.lua.

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.