-
-
Notifications
You must be signed in to change notification settings - Fork 741
feat: add a new --json to better supports interactivity in scripts #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
in preparation for adding a third list option, let's first collect the existing two list options into a struct to avoid expanding parameter lists this also lets us simplify the multiple ListTask* functions into a single one which accepts options and switches internally; this is more consistent with the tell, don't ask pattern of pushing implementation below the level where clients care.
Can you please also update the docs to give an example of output file? If you want I can easily write a JSON Schema specification once I have the example, I happened that I authored quite a few in the recent years. |
@ssbarnea let's first validate that this output is what you expect, then I am happy to update the docs.
|
@davidalpert can we add JSON tags to the |
I can add struct tags to JSON key formatting is easy to switch up if |
updated the sample JSON output |
Hi @davidalpert, thanks for opening this PR. I think this will need to be more advanced, though. Instead of just dumping tasks in JSON, I would like to have a separated package to handle this, with handcrafted structs with just the things that are relevant to code editors. It'll need to have variables in its computed state, for example. Also, we'll probably need to ability to output only for a specific task as well, because always outputting the whole thing may be a performance issue on big Taskfiles, specially when dynamic variables are in place. Let me know if you would still like to continue working on this. I'm open to give you the direction needed. If you don't want or won't have the time for that, just let us know so someone else will be free to work on it without having a conflict with your work. |
Bit of feedback unrelated to proposed implementation:
Over the last 3 years, I wrote 10+ JSON schemas for various projects, including big ones like Ansible. I made many mistakes, but I think I did learn from them (these bullet points being part of conclusions). |
Thank you for the feedback. I initially picked #764 during Hactoberfest as a way into this code base but I am happy to continue the effort to refine this PR (or rewrite it from the ground up) so that it can align with your expectations. Being new to the project I wasn't sure that this was the right way to approach this request, so I appreciate the guidance. Specifically, you mentioned:
Please jot down whatever level of detail you have in mind in terms of what you would like to see this PR turn into. As I mentioned, this was an initial spike into the code for me, so I am happy to let this one go and start over in whatever direction you prefer. |
in fact, looking at the code changes in October I would like to close this PR, take the lessons learned and the discussion, and start fresh with your guidance as detailed as you would like to give it. Let's move the discussion back to #764 to align on the approach. |
Closing in favor of #936. |
resolves #764