[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] BOM/line-ending scripts: wildcard node_modules exclusion

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <692de603b0331_2a17bba0359cc@gitlab-sidekiq-low-urgency-cpu-bound-v2-5645d46d6b-kmrpf.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
92b280e9 by Sandeep D at 2025-12-01T18:53:13+00:00
[FIX] BOM/line-ending scripts: wildcard node_modules exclusion
---
* [FIX] BOM/line-ending scripts: wildcard node_modules exclusion

See merge request tikiwiki/tiki!9156

- - - - -


3 changed files:

- doc/devtools/check_bom_encoding.php
- doc/devtools/check_unix_ending_line.php
- lib/core/BOMChecker/Scanner.php


Changes:

=====================================
doc/devtools/check_bom_encoding.php
=====================================
@@ -16,7 +16,6 @@ $dir = realpath(__DIR__ . '/../../') ;
 $excludeFolders = [
     $dir . '/vendor',
     $dir . '/vendor_bundled',
-    $dir . '/node_modules',
     $dir . '/temp',
     $dir . '/.git',
 ];


=====================================
doc/devtools/check_unix_ending_line.php
=====================================
@@ -26,17 +26,9 @@ $excludePattern = [
     // temp folder (generated files)
     $dir . '/' . TEMP_PATH,
 
-    // node_modules (third-party dependencies)
-    $dir . '/node_modules',
-
     // bin directory (executables)
     $dir . '/bin',
 
-    // folders where node modules can be installed
-    $dir . '/lib/vue-mf/duration-picker/node_modules',
-    $dir . '/lib/vue-mf/kanban/node_modules',
-    $dir . '/lib/vue-mf/styleguide/node_modules',
-
     // libraries included in tiki, so taking it as is
     $dir . '/lib/openlayers/theme/default/style.tidy.css',
     $dir . '/lib/openlayers/theme/default/ie6-style.tidy.css',
@@ -45,6 +37,11 @@ $excludePattern = [
     $dir . '/lib/vue/lib/ui-predicate-vue.css',
 ];
 
+// Wildcard patterns - these can appear at multiple levels
+$wildcardExcludes = [
+    '/node_modules/',
+];
+
 $extensions = [
     'php',
     'tpl',
@@ -83,6 +80,16 @@ foreach ($iterator as $file) {
     $fileInfo = pathinfo($currentFile);
     $excludeFile = (str_replace($excludePattern, '', $currentFile) != $currentFile);
 
+    // Check wildcard patterns (e.g., node_modules at any level)
+    if (! $excludeFile) {
+        foreach ($wildcardExcludes as $pattern) {
+            if (strpos($currentFile, $pattern) !== false) {
+                $excludeFile = true;
+                break;
+            }
+        }
+    }
+
     if ($excludeFile === false) {
         if (isset($fileInfo['extension']) && in_array($fileInfo['extension'], $extensions)) {
             $filesToCheck[] = $currentFile;


=====================================
lib/core/BOMChecker/Scanner.php
=====================================
@@ -86,6 +86,11 @@ class BOMChecker_Scanner
             return;
         }
 
+        // Skip node_modules at any level (can appear in multiple nested locations)
+        if (basename($sourceDir) === 'node_modules') {
+            return;
+        }
+
         $sourceDir = $this->fixDirSlash($sourceDir);
 
         // Copy files and directories.



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/92b280e93d3b52f3a72d3b23c50ae03d6ff16ad9

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/92b280e93d3b52f3a72d3b23c50ae03d6ff16ad9
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.