]> git.ipfire.org Git - thirdparty/blocklistproject/lists.git/commitdiff
Ensuring that all lines that start with # are followed by a space
authorCharlie Fish <fishcharlie@me.com>
Mon, 12 Jul 2021 00:58:36 +0000 (18:58 -0600)
committerCharlie Fish <fishcharlie@me.com>
Mon, 12 Jul 2021 00:58:36 +0000 (18:58 -0600)
scripts/create-everything-list.js
scripts/lint.js

index df564a3a85a752966f504e9082c45a04c0834fbb..d5fde74794cd11b77874fdfe2fb4bd2431c8211e 100644 (file)
@@ -45,21 +45,21 @@ const listsToIncludeInEverythingList = [
        }));
 
        let everythingListContent =
-`#------------------------------------[UPDATE]--------------------------------------
+`# ------------------------------------[UPDATE]--------------------------------------
 # Title: The Block List Project - Everything List
 # Expires: 1 day
 # Homepage: https://blocklist.site
 # Help: https://github.com/blocklistproject/lists/wiki/
 # License: https://unlicense.org
 # Total number of network filters:
-#------------------------------------[SUPPORT]-------------------------------------
+# ------------------------------------[SUPPORT]-------------------------------------
 # You can support by:
 # - reporting false positives
 # - making a donation: https://paypal.me/blocklistproject
-#-------------------------------------[INFO]---------------------------------------
+# -------------------------------------[INFO]---------------------------------------
 #
 # Everything list
-#------------------------------------[FILTERS]-------------------------------------
+# ------------------------------------[FILTERS]-------------------------------------
 `;
        domains.forEach((val) => everythingListContent += `0.0.0.0 ${val}\n`);
 
index f7d8ff665f55596a603622b81c3d47070ab721a9..fd61e22901ea3e68acf757b5bfe4de5f6ff0c599 100644 (file)
@@ -24,6 +24,12 @@ const path = require("path");
                                        hasError = true;
                                }
                        }
+
+                       // Ensuring that all lines that start with `#` are followed by a space
+                       if (line.startsWith("#") && line.length > 1 && line[1] !== " ") {
+                               console.error(`Line ${index + 1} in ${file} should have a space after #.`);
+                               hasError = true;
+                       }
                });
        }));