mirror of
				https://github.com/kevinveenbirkenbach/directory-content-scanner.git
				synced 2025-11-04 03:48:22 +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"
 | 
					    C = ".c"
 | 
				
			||||||
    CPP = ".cpp"
 | 
					    CPP = ".cpp"
 | 
				
			||||||
    H = ".h"
 | 
					    H = ".h"
 | 
				
			||||||
 | 
					    BASH = ".sh"
 | 
				
			||||||
 | 
					    SHELL = ".bash"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def remove_comments(content, file_type):
 | 
					    def remove_comments(content, file_type):
 | 
				
			||||||
@@ -34,6 +36,12 @@ class CodeProcessor:
 | 
				
			|||||||
            CodeProcessor.H: [
 | 
					            CodeProcessor.H: [
 | 
				
			||||||
                (r'\s*//.*', '',0),
 | 
					                (r'\s*//.*', '',0),
 | 
				
			||||||
                (r'/\*.*?\*/', '',0)
 | 
					                (r'/\*.*?\*/', '',0)
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            CodeProcessor.BASH: [
 | 
				
			||||||
 | 
					                (r'\s*#.*', '', 0)
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            CodeProcessor.SHELL: [
 | 
				
			||||||
 | 
					                (r'\s*#.*', '', 0)
 | 
				
			||||||
            ]
 | 
					            ]
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user