Skip to content

Commit

Permalink
Escape HTML tags in oss-check
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofabri committed Aug 27, 2017
1 parent 5a23350 commit b635d1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ has_app_changes = !modified_files.grep(/Source/).empty?
has_test_changes = !modified_files.grep(/Tests/).empty?
has_danger_changes = !modified_files.grep(/Dangerfile|script\/oss-check|Gemfile/).empty?
has_rules_changes = !modified_files.grep(/Source\/SwiftLintFramework\/Rules/).empty?
has_rules_docs_changes = !modified_files.include?('Rules.md')
has_rules_docs_changes = modified_files.include?('Rules.md')

# Add a CHANGELOG entry for app changes
if !modified_files.include?('CHANGELOG.md') && has_app_changes
Expand Down
7 changes: 5 additions & 2 deletions script/oss-check
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require 'fileutils'
require 'open3'
require 'optparse'
require 'erb'

################################
# Options
Expand Down Expand Up @@ -227,10 +228,12 @@ def diff_and_report_changes_to_danger
master = non_empty_lines("#{@working_dir}/master_reports/#{repo.name}.txt")

(master - branch).each do |fixed|
message "This PR fixed a violation in #{repo.name}: [#{fixed}](#{convert_to_link(repo, fixed)})"
escaped_message = ERB::Util.html_escape fixed
message "This PR fixed a violation in #{repo.name}: [#{escaped_message}](#{convert_to_link(repo, fixed)})"
end
(branch - master).each do |violation|
warn "This PR introduced a violation in #{repo.name}: [#{violation}](#{convert_to_link(repo, violation)})"
escaped_message = ERB::Util.html_escape violation
warn "This PR introduced a violation in #{repo.name}: [#{escaped_message}](#{convert_to_link(repo, violation)})"
end
message repo.duration_report
end
Expand Down

0 comments on commit b635d1f

Please sign in to comment.