-
Notifications
You must be signed in to change notification settings - Fork 1
jq.lua: Use temp_file strategy for non-Win32 machines #3
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
base: master
Are you sure you want to change the base?
Conversation
use temp_file for non-windows is_valid debug is_valid back to original debug loggers more debug loggers fix debug log exit_status remove redundant debugs, add validity check debug bool to string debugging debugging debugging debugging In jq.lua, use temp file for jq actions. remove debug line
Use temp file for non-windows jq actions
Because of issues related in Issue #2 |
@VPavliashvili I did some preliminary testing with some of the functions I am commonly using. I'll be making another PR in the next couple of weeks for some additional improvements if you're open to it. |
The init_path logic below seems to account for OS path separators
For OS management of temp files
@jaredbarranco I started to run tests too and found some problems
When I tried to format after your PR I got this result (run :JsonMinifyFile)
note extra spacing, I think this is a regress.
please consider finding the cause and fixing it |
fix: use jq -c on get_collapsed
@VPavliashvili Thanks for catching that regression. I believe I corrected it with this commit. I need to do some additional regression testing before I can confidently say it's ready to go. On a related note, I'm going to open an issue for discussion around testing framework - something I think would be helpful for making sure regression like this one doesn't happen in the future. |
@jaredbarranco Do you think it's better to incorporate unit tests first and then proceed with this PR or other way around? |
@VPavliashvili Unit testing first would be best so that we can get a baseline expectation. If possible, I think you should be the one to generate those because I can't run ANY of the functions with master from your repo on Mac and everything but the JsonKeysTo* functions on linux. |
@jaredbarranco unfortunately I am on a tight schedule right now and you will have to wait for a little while before I will be able to do the work, otherwise I am down to your proposition. EDIT: Lets continue unit testing related discussion in #4 and leave this section specific to the PR |
…read move json-nvim to json_nvim move lua/json-nvim to lua/json_nvim not including files that were update for string input testin add M. functions that accept a string for operations minify, format, and escape - accept a string working test script with input/goldens delete un-used lua/json_nvim/json-nvim.lua Change name from Token to Node github actions workflow
echo runner temp cache apt, env. namespace incorrect fix tmpdir declaration set temp for windows
ignore .expected
Feat/golden testing
update readme for node name update
This method correctly handles single quotes and allows for better debugging of the plugin when users have questions. If a method/function errors out the ~/.local/share/nvim/lazy/json-nvim/temp.json or other PLUGIN_HOME dir will have the "in-progress" file.