Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365193 )

Change subject: Add tooling for svg size checking
......................................................................

Add tooling for svg size checking

Bug: T170639
Change-Id: Ibcd5c29340d16c9cffc6e2eb90d33ee89b69874f
---
A dev_scripts/svg_check.sh
M package.json
2 files changed, 19 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/93/365193/1

diff --git a/dev_scripts/svg_check.sh b/dev_scripts/svg_check.sh
new file mode 100755
index 0000000..3c7ef64
--- /dev/null
+++ b/dev_scripts/svg_check.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+found=0
+
+for svgfile in `find resources -type f -name "*.svg"`; do
+  outfile="$svgfile.tmp"
+  node_modules/.bin/svgo --config .svgo.yml -i $svgfile -o $outfile -q
+  if [ $(wc -c $svgfile | awk '{print $1}') -gt $(wc -c $outfile | awk '{print 
$1}') ]; then
+    echo "File $svgfile is not compressed"
+    found=$((found + 1))
+  fi
+  rm $outfile
+done
+
+if [ $found -gt 0 ]; then
+  echo "Found $found uncompressed SVG files. Please compress the files and 
re-submit the patch"
+  exit 1
+fi
\ No newline at end of file
diff --git a/package.json b/package.json
index 9ae3ac4..7184a14 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,13 @@
 {
        "private": true,
        "scripts": {
-               "test": "grunt test"
+               "test": "grunt test && dev-scripts/svg_check.sh"
        },
        "dependencies": {
                "svgo": ">=0.4.4"
        },
        "devDependencies": {
-               "eslint-config-wikimedia": "0.3.0",
+               "eslint-config-wikimedia": "0.4.0",
                "grunt": "^1.0.1",
                "grunt-banana-checker": "^0.5.0",
                "grunt-contrib-watch": "^1.0.0",

-- 
To view, visit https://gerrit.wikimedia.org/r/365193
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcd5c29340d16c9cffc6e2eb90d33ee89b69874f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to