lalten / xmllint-format-hook

Pre-commit hook to format XML files with xmllint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xmllint format hook for pre-commit

Format your xml files with xmllint.

Usage

Add this hook to your .pre-commit-config.yaml configuraiton:

  - repo: https://github.com/lalten/xmllint-format-hook
    rev: 1.0.0
    hooks:
      - id: xmllint-format

You can override the args being used by the hook. The following matches the defaults:

  - repo: https://github.com/lalten/xmllint-format-hook
    rev: 1.0.0
    hooks:
      - id: xmllint-format
        args:
          - --recover # Output any parsable portions of an invalid document.
          - --format # Reformat and reindent the output.
          - --noblanks # Drop ignorable blank spaces.
          - --nsclean # Remove redundant namespace declarations.
          - --XMLLINT_INDENT # Use a specific indentation string (normally this is an env var)
          - "    " # Indentation string to use

About

Pre-commit hook to format XML files with xmllint

License:MIT License


Languages

Language:Shell 78.0%Language:Dockerfile 22.0%