mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
Escape HTML tags in oss-check
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+5
-2
@@ -7,6 +7,7 @@
|
||||
require 'fileutils'
|
||||
require 'open3'
|
||||
require 'optparse'
|
||||
require 'erb'
|
||||
|
||||
################################
|
||||
# Options
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user