From 7207e3554c681301e90c4fa4b4de2432849fc94e Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Fri, 22 Mar 2024 12:33:43 -0300 Subject: [PATCH] cleaner.rb: don't use in-repo configs --- assets/cleaner.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/cleaner.rb b/assets/cleaner.rb index 87c4752e..c33e3894 100755 --- a/assets/cleaner.rb +++ b/assets/cleaner.rb @@ -1,8 +1,6 @@ #!/usr/bin/env ruby require 'optparse' -DEFAULT_MATCHER_FILENAME = ".github/security-action-blocklist.txt" - class Matcher def initialize(*blocklist_files) @blocklist = [] @@ -33,14 +31,14 @@ def match?(line) end options = { - matcher: Matcher.new(DEFAULT_MATCHER_FILENAME) + matcher: Matcher.new() } OptionParser.new do |opts| opts.banner = "Usage: reviewdog-adapter.rb [options]" opts.on("--svgo", "Add SVGO String") do |v| options[:svgo] = true - options[:matcher] = Matcher.new(DEFAULT_MATCHER_FILENAME, "#{ENV["SCRIPTPATH"]}/dtd/blocklist.txt") + options[:matcher] = Matcher.new("#{ENV["SCRIPTPATH"]}/dtd/blocklist.txt") end opts.on("--assignees", "Add Assignees String") do |v| @@ -49,12 +47,12 @@ def match?(line) opts.on("--sveltegrep", "Remove Extracted Script Extension, and use semgrep blocklist") do |v| options[:sveltegrep] = true - options[:matcher] = Matcher.new(DEFAULT_MATCHER_FILENAME, "#{ENV["SCRIPTPATH"]}/semgrep_rules/blocklist.txt") + options[:matcher] = Matcher.new("#{ENV["SCRIPTPATH"]}/semgrep_rules/blocklist.txt") end opts.on("--semgrep", "Use semgrep blocklist") do |v| options[:semgrep] = true - options[:matcher] = Matcher.new(DEFAULT_MATCHER_FILENAME, "#{ENV["SCRIPTPATH"]}/semgrep_rules/blocklist.txt") + options[:matcher] = Matcher.new("#{ENV["SCRIPTPATH"]}/semgrep_rules/blocklist.txt") end end.parse!