mirror of
				https://github.com/kevinveenbirkenbach/directory-content-scanner.git
				synced 2025-11-03 19:38:08 +00:00 
			
		
		
		
	Added logic to remove bash and shell comments
This commit is contained in:
		
							
								
								
									
										8
									
								
								scan.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								scan.py
									
									
									
									
									
								
							@@ -9,6 +9,8 @@ class CodeProcessor:
 | 
			
		||||
    C = ".c"
 | 
			
		||||
    CPP = ".cpp"
 | 
			
		||||
    H = ".h"
 | 
			
		||||
    BASH = ".sh"
 | 
			
		||||
    SHELL = ".bash"
 | 
			
		||||
 | 
			
		||||
    @staticmethod
 | 
			
		||||
    def remove_comments(content, file_type):
 | 
			
		||||
@@ -34,6 +36,12 @@ class CodeProcessor:
 | 
			
		||||
            CodeProcessor.H: [
 | 
			
		||||
                (r'\s*//.*', '',0),
 | 
			
		||||
                (r'/\*.*?\*/', '',0)
 | 
			
		||||
            ],
 | 
			
		||||
            CodeProcessor.BASH: [
 | 
			
		||||
                (r'\s*#.*', '', 0)
 | 
			
		||||
            ],
 | 
			
		||||
            CodeProcessor.SHELL: [
 | 
			
		||||
                (r'\s*#.*', '', 0)
 | 
			
		||||
            ]
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user