This repository provides pre-commit hooks for formatting XML files using xmlstarlet and sorting attributes using xsltproc.
Formats XML files with consistent indentation using xmlstarlet.
- Command:
xmlstarlet fo --indent-spaces 4 - Effect: Pretty-prints XML with 4-space indentation
- Requirement:
xmlstarlet
Sorts XML element attributes alphabetically using XSLT, and then formats the result with xmlstarlet.
- Command:
xsltproc sort-attrs.xslt | xmlstarlet fo - Effect: Alphabetically orders attributes in each element and formats
- Requirement:
xsltproc,xmlstarlet
- repo: https://github.com/Odoo-Ninjas/precommit-hooks
rev: main
hooks:
- id: make_odoo_robot_tests_githubworkflow
args:
- .github/workflows/testing.yml
- Install required tools:
brew install xmlstarlet libxslt # macOS sudo apt install xmlstarlet xsltproc # Debian/Ubuntu