Linting: require description of manual geometries
Refs #22
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..05da74b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+cache:
+ directories:
+ - "node_modules"
diff --git a/lint-json.js b/lint-json.js
index 90b402a..9884ccf 100644
--- a/lint-json.js
+++ b/lint-json.js
@@ -9,7 +9,7 @@
})
Object.keys(zoneCfg).forEach(zone => {
- zoneCfg[zone].forEach(operation => {
+ zoneCfg[zone].forEach((operation, idx) => {
if (operation.source === 'overpass') {
// check if source is defined
if (!osmBoundarySources[operation.id]) {
@@ -19,6 +19,12 @@
} else {
sourcesUsage[operation.id] = true
}
+ } else if (operation.source.indexOf('manual') > -1 &&
+ (!operation.description ||
+ operation.description.length < 3)) {
+ numErrors++
+
+ console.error(`No description of ${operation.source} for operation ${idx} of zone: ${zone}`)
}
})
})
diff --git a/package.json b/package.json
index ebf803b..37e60ba 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "Scripts to create a timezone shapefile from multiple sources",
"main": "index.js",
"scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
+ "test": "node lint-json.js"
},
"keywords": [
"timezone",