From 4a4fd680089e1e8e79c3ed47df39b02be09ed94c Mon Sep 17 00:00:00 2001 From: "~ . ~" Date: Thu, 16 Jan 2025 12:18:34 -0500 Subject: [PATCH] use pretty data for xml --- package-lock.json | 11 +++++++++++ package.json | 1 + src/content/module.mk | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 969b121bc..4cd717680 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "@types/jsdom": "^21.1.7", "@types/xml2js": "^0.4.14", "cross-env": "^7.0.3", + "pretty-data": "^0.40.0", "typescript": "^5.5.2" } }, @@ -2921,6 +2922,16 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pretty-data": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/pretty-data/-/pretty-data-0.40.0.tgz", + "integrity": "sha512-YFLnEdDEDnkt/GEhet5CYZHCvALw6+Elyb/tp8kQG03ZSIuzeaDWpZYndCXwgqu4NAjh1PI534dhDS1mHarRnQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", diff --git a/package.json b/package.json index 29ae337b6..7b8d714c9 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@types/jsdom": "^21.1.7", "@types/xml2js": "^0.4.14", "cross-env": "^7.0.3", + "pretty-data": "^0.40.0", "typescript": "^5.5.2" } } diff --git a/src/content/module.mk b/src/content/module.mk index 88de7e22c..0a0052e6e 100644 --- a/src/content/module.mk +++ b/src/content/module.mk @@ -54,7 +54,7 @@ format-xml: @echo "Formatting XML files..." @for file in $(XML_FILES); do \ echo "Formatting $$file..."; \ - xmllint --format --output "$$file" "$$file"; \ + npx pretty-data-xml "$$file" > "$$file.tmp" && mv "$$file.tmp" "$$file"; \ done .PHONY: format-json