Skip to content

Commit

Permalink
Match globally excluded paths more accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
presidentbeef committed Oct 13, 2024
1 parent e4f49f6 commit e2b71b1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/brakeman/app_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,14 @@ def reject_skipped_files(paths)
end
end

EXCLUDED_PATHS = %w[
/generators/
EXCLUDED_PATHS = regex_for_paths %w[
generators/
lib/tasks/
lib/templates/
db/
spec/
test/
tmp/
log/
]

def reject_global_excludes(paths)
Expand All @@ -219,9 +218,7 @@ def reject_global_excludes(paths)
if @skip_vendor and relative_path.include? 'vendor/' and !in_engine_paths?(path) and !in_add_libs_paths?(path)
true
else
EXCLUDED_PATHS.any? do |excluded|
relative_path.include? excluded
end
match_path EXCLUDED_PATHS, path
end
end
end
Expand Down

0 comments on commit e2b71b1

Please # to comment.