From 095701e3040e7f1826ee07d09664eb0a9288d872 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 21 Jul 2024 09:22:53 +0200 Subject: [PATCH] Added logic to remove bash and shell comments --- scan.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scan.py b/scan.py index 6d873f4..1909b92 100644 --- a/scan.py +++ b/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) ] }