diff --git a/db/migrate/20220415215112_migrate_testruns.rb b/db/migrate/20220415215112_migrate_testruns.rb index 52622e4d..4c29b368 100644 --- a/db/migrate/20220415215112_migrate_testruns.rb +++ b/db/migrate/20220415215112_migrate_testruns.rb @@ -11,7 +11,10 @@ class MigrateTestruns < ActiveRecord::Migration[6.1] REAL_EXIT = Regexp.compile(/\A(?>(?(?{".*?)?(?>{"cmd":(?> |"write","stream":"stdout","data":)?"#?exit(?>\\[nr])?"})+(?.*))|(?.*?)(?>#?exit\s*)+(?.*))\z/m) STDERR_WRITTEN = Regexp.compile(/^(?:(?\r*[^\n\r]*\.rb:\d+:.*)|(?\r*[^\n\r]*\.java:\d+: error.*|\r*Exception in thread.*|\r*There was .*|\r*[^\n\r]*java\.lang\..*|\r*make: \*\*\* \[.*))\z/m) FIND_JSON = Regexp.compile(/{(?:(?:"(?:\\.|[^\\"])+?"\s*:\s*(?:"(?:\\.|[^\\"])*?"|-?\d++(?:\.\d++)?|\[.*?\]|{.*?}|null))+?\s*,?\s*)+}/) - REPLACE_INCOMPLETE_UNICODE = Regexp.compile(/(?:\\?\\u[\da-f]{0,3}|\\?\\u\{[\da-f]{0,4})"}\z/) + # We identify incomplete Unicode characters. Valid unicode characters are: + # \uXXXX, \u{XXXXX}, \udYXX\udZXX with X = 0-9a-f, Y = 89ab, Z = cdef + # Every incomplete prefix of a valid unicode character is identified + REPLACE_INCOMPLETE_UNICODE = Regexp.compile(/(?:\\?\\u[\da-f]{0,3}|\\?\\ud[89ab][\da-f]{2}\\?(?:\\(?:u(?:d(?:[cdef][\da-f]?)?)?)?)?|\\?\\u\{[\da-f]{0,4})"}\z/) # NOTE: `update_columns` won't run validations nor update the `updated_at` timestamp. # This is what we want here, thus we disable Rubocop for this migration.