gbowne1 / json-maestro

JSONMaestro is a powerful tool designed for cleaning and processing JSON-like files. It simplifies tasks such as removing comments, eliminating duplicate keys, adding schema keys, and sorting keys. Ideal for developers working with configuration files and API responses, JSONMaestro enhances data integrity and prepares JSON data for further analysis
MIT License
2 stars 2 forks source link

JSONMaestro is unable to find Visual Studio Code or Visual Studio configuration files #4

Open gbowne1 opened 4 weeks ago

gbowne1 commented 4 weeks ago

I tried several ways to get it to properly locate any JSON Visual Studio or Visual Studio code configuration files

especially the ones in the project directory.

Instead, you get;

$ python3 jsonmaestro.py
Enter the path to your JSON, JSONC, or VSCode settings.json file: ./vscode/estensions.json
Error: File './vscode/estensions.json' not found.
shoshta73 commented 6 days ago

What needs to be done here?

gbowne1 commented 5 days ago

I don't know @shoshta73 not completely sure why it would not just find the files.

shoshta73 commented 5 days ago

Allright i will check whats going

shoshta73 commented 5 days ago

Just saw it.

Given this input where you have relative path from PRJ_ROOT you have made a type in filename, and you are missing leading dot on the vscode directory.

python3 jsonmaestro.py
Enter the path to your JSON, JSONC, or VSCode settings.json file: ./vscode/estensions.json
Error: File './vscode/estensions.json' not found.
'./vscode/estensions.json' -> '.vscode/extensions.json' -> this fixes the issue
   ^       ^typo is here
   I
   > missing leading dot
gbowne1 commented 3 days ago

@shoshta73

One should be able to point json-maestro to any file or set of files and have it rebuild the JSON no matter which directory it is in.

package.json and also .vscode/extensions.json, settings.json, launch.json, tasks.json shold get validated by schema.

shoshta73 commented 3 days ago

So maybe an automated file shearch will cover this?

gbowne1 commented 3 days ago

I don't know about an automated file search, but the user should be able to type in the correct path either relative or absolute and it should find the file or files to be parsed.

gbowne1 commented 3 days ago

if no json file was found it might be advisable to print something like "Error: No JSON found".

shoshta73 commented 3 days ago

I don't know about an automated file search, but the user should be able to type in the correct path either relative or absolute and it should find the file or files to be parsed.

what if the absolute filepath resolves to priveledged fs (like /opt/stacks)?

gbowne1 commented 3 days ago

sure

shoshta73 commented 3 days ago

Is it ok if procced with this patchset?

gbowne1 commented 3 days ago

yes it is.

gbowne1 commented 3 days ago

Only thing I see is in helper.py FORMAT is spelled FROMAT.