Loading...
Loading...
Format and validate code in various languages. Python, JavaScript, JSON, YAML, Markdown, and more. Uses standard formatters when available.
npx skill4agent add winsorllc/upgraded-carnival code-format| Language | Formatter | Notes |
|---|---|---|
| Python | black, autopep8 | Falls back to auto-format |
| JavaScript | prettier | If installed |
| TypeScript | prettier | If installed |
| JSON | python | Built-in |
| YAML | pyyaml | If installed |
| Markdown | prettier | If installed |
| HTML | prettier | If installed |
| CSS | prettier | If installed |
| SQL | sqlparse | If installed |
| Shell | shfmt | If installed |
{baseDir}/format-code.sh <file>
{baseDir}/format-code.sh <file> --language python
{baseDir}/format-code.sh --stdin --language js < code.js{baseDir}/validate-code.sh <file>
{baseDir}/validate-code.sh <file> --language python
{baseDir}/validate-code.sh --stdin --language json < data.json{baseDir}/format-code.sh --languages--language <lang>--stdin--out <file>--check--diff--indent <n>{baseDir}/format-code.py script.pycat data.json | {baseDir}/format-code.sh --stdin --language json{baseDir}/format-code.sh script.py --check
# Exit 0 if formatted, 1 if needs formatting{baseDir}/format-code.sh config.json --indent 4{baseDir}/validate-code.sh script.py
# Output: ✓ Valid Python syntax--out