Skip to content

feat: add normalize xml hook#29

Merged
vaahtokarkki merged 1 commit into
mainfrom
pre-commit-normalize-xml
Mar 19, 2026
Merged

feat: add normalize xml hook#29
vaahtokarkki merged 1 commit into
mainfrom
pre-commit-normalize-xml

Conversation

@vaahtokarkki

Copy link
Copy Markdown
Contributor

Normalize XML

Add normalize XML pre-commit hook. By default, it applies to .xml, .ui, and .qml files. Note that .qml files are allowed to contain invalid XML.

Usage:

- repo: https://github.com/nlsfi/qgis-plugin-dev-tools
  rev: tag
  hooks:
    - id: normalize-xml
      args: [
        "--remove-tag", "fieldConfiguration",
        "--remove-tag", "editable",
        "--remove-tag", "labelOnTop",
        "--remove-tag", "reuseLastValue",
        "--remove-tag", "editforminitcode",
      ]

@vaahtokarkki vaahtokarkki requested a review from Joonalai March 19, 2026 10:46
@vaahtokarkki vaahtokarkki self-assigned this Mar 19, 2026
@vaahtokarkki vaahtokarkki force-pushed the pre-commit-normalize-xml branch 3 times, most recently from fc3cca2 to 072c94b Compare March 19, 2026 11:26

@Joonalai Joonalai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Good idea to not require installing other than lxml to run this hook. Just add section to README.md and you are good to go 😄

@vaahtokarkki vaahtokarkki force-pushed the pre-commit-normalize-xml branch from 072c94b to 29f5e86 Compare March 19, 2026 12:16
@vaahtokarkki vaahtokarkki force-pushed the pre-commit-normalize-xml branch from 29f5e86 to b6af9b0 Compare March 19, 2026 12:21
@vaahtokarkki vaahtokarkki merged commit c4171bd into main Mar 19, 2026
3 checks passed
@vaahtokarkki vaahtokarkki deleted the pre-commit-normalize-xml branch March 19, 2026 12:23
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.

2 participants