Skip to content

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

Merged
hsanson merged 1 commit into
dense-analysis:masterfrom
idbrii:jsontool
Feb 24, 2025
Merged

Add fixer for json: python's json.tool#4847
hsanson merged 1 commit into
dense-analysis:masterfrom
idbrii:jsontool

Conversation

@idbrii
Copy link
Copy Markdown
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')

@stale
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor Author

idbrii commented Feb 11, 2025

That should fix lint errors.

Comment thread doc/ale-json.txt
@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
Copy Markdown
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
Copy Markdown
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
@idbrii idbrii deleted the jsontool branch February 26, 2025 15:23
cyyever pushed a commit to cyyever/ale that referenced this pull request Mar 24, 2025
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.
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