Skip to content
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

Add fixer for json: python's json.tool #4847

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

idbrii
Copy link
Contributor

@idbrii idbrii commented Oct 22, 2024

Resolves #4314.

Add a fixer that's built into python for json formatting. Include a couple arguments in docs to make these features more discoverable.

Uses stdin-based fixing so you don't need to save the file to fix.

Unlike most python commands (i.e., pyflakes), this one doesn't seem to include a standalone executable. I can't find any other ale modules that get a python path, so this fixer has its own variable:

call ale#Set('json_pytool_executable', 'python')

Copy link

stale bot commented Feb 1, 2025

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.

@stale stale bot added the stale PRs/Issues no longer valid label Feb 1, 2025
@idbrii
Copy link
Contributor Author

idbrii commented Feb 8, 2025

Please don't close this PR.

@stale stale bot removed the stale PRs/Issues no longer valid label Feb 8, 2025
@idbrii idbrii force-pushed the jsontool branch 2 times, most recently from 0048478 to 4f264b2 Compare February 11, 2025 23:41
@idbrii
Copy link
Contributor Author

idbrii commented Feb 11, 2025

That should fix lint errors.

@idbrii idbrii force-pushed the jsontool branch 4 times, most recently from 04e9826 to 2b29d42 Compare February 20, 2025 08:12
Resolves dense-analysis#4314.

Add a fixer that's built into python for json formatting. Include a
couple arguments in docs to make these features more discoverable.

Uses stdin-based fixing so you don't need to save the file to fix.
@idbrii
Copy link
Contributor Author

idbrii commented Feb 20, 2025

Ah, finally figured out toc lint issue: the validation pattern doesn't handle . in the name. Used pytool instead of json.tool to resolve.

@idbrii idbrii requested a review from hsanson February 20, 2025 17:59
Copy link
Contributor

@hsanson hsanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.

@hsanson hsanson merged commit d38a3f7 into dense-analysis:master Feb 24, 2025
7 checks passed
@idbrii idbrii deleted the jsontool branch February 26, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add JSON fixer using 'python -m json.tool'
2 participants