Skip to content

Commit

Permalink
cleaner.rb: don't use in-repo configs
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Mar 22, 2024
1 parent c656cf2 commit 7207e35
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions assets/cleaner.rb
Original file line number Diff line number Diff line change
@@ -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 = []
Expand Down Expand Up @@ -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|
Expand All @@ -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!

Expand Down

0 comments on commit 7207e35

Please sign in to comment.