oxsecurity / megalinter

🦙 MegaLinter analyzes 50 languages, 22 formats, 21 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
https://megalinter.io
GNU Affero General Public License v3.0
1.9k stars 231 forks source link

Format mkdocs search index in place #3890

Closed echoix closed 1 month ago

echoix commented 1 month ago

The python module json.tool can use the same file as input and output, that formats in place. We can also specify to sort the keys, since mkdocs does not assure the order of the keys. It will result in a smaller diff between page builds.

I also set the no indent flag, so there are newlines, but without extra spaces or tabs. The file is a little smaller (faster to load), and still the same facility for git to diff lines (instead of compact, where the whole file is in one line and needs to be replaced) See https://docs.python.org/3/library/json.html#cmdoption-json.tool-indent

I was about to include this in my pyproject.toml PR, but it can be here alone first

Proposed Changes

Readiness Checklist

Author/Contributor

Reviewing Maintainer

github-actions[bot] commented 1 month ago

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ API spectral 1 0 1.56s
✅ BASH bash-exec 5 0 0.02s
✅ BASH shellcheck 5 0 0.12s
✅ BASH shfmt 5 0 0 0.03s
✅ COPYPASTE jscpd yes no 3.78s
✅ DOCKERFILE hadolint 126 0 13.87s
✅ JSON jsonlint 20 0 0.24s
✅ JSON v8r 22 0 30.89s
⚠️ MARKDOWN markdownlint 264 0 291 32.14s
✅ MARKDOWN markdown-table-formatter 264 0 0 137.02s
⚠️ PYTHON bandit 209 64 3.63s
✅ PYTHON black 209 0 0 5.2s
✅ PYTHON flake8 209 0 2.47s
✅ PYTHON isort 209 0 0 0.79s
✅ PYTHON mypy 209 0 19.15s
✅ PYTHON pylint 209 0 24.78s
✅ PYTHON ruff 209 0 0 0.09s
✅ REPOSITORY checkov yes no 41.53s
✅ REPOSITORY git_diff yes no 0.02s
⚠️ REPOSITORY grype yes 1 15.2s
✅ REPOSITORY secretlint yes no 13.01s
✅ REPOSITORY trivy yes no 21.68s
✅ REPOSITORY trivy-sbom yes no 1.74s
⚠️ REPOSITORY trufflehog yes 1 10.97s
✅ SPELL cspell 687 0 11.38s
⚠️ SPELL lychee 346 7 6.06s
✅ XML xmllint 3 0 0 0.03s
✅ YAML prettier 160 0 0 4.34s
✅ YAML v8r 102 0 180.81s
✅ YAML yamllint 161 0 2.34s

See detailed report in MegaLinter reports

_MegaLinter is graciously provided by OX Security_