Add settings for controlling the Trojan Code confusables checks.
Review Request #12787 — Created Jan. 13, 2023 and updated
This introduces new settings in the Diff Viewer Settings page to control
whether Trojan Code confusable checks should be enabled or which
languages should be considered safe.
This is shown in-between the "Limits" and "Advanced" section. The list
of languages is presented as a series of checkboxes. There aren't too
many there, and we don't really have a better widget for displaying this
list at this time (ideally we'd use the Related Object selector, but
it's not built for this, and I wanted to minimize the UI work for this
These settings are stored in a general way, opening the door for future
code safety checker preferences. They're available to the diff machinery
through the new
DiffSettingsobject, and used in the chunk generator
when performing a check.
Changing these settings will automatically invalidate any caches/ETags,
ensuring they take effect immediately.
Unit tests pass.
Tested with a Trojan Code sample set, tested with confusable checks on,
on with excluded languages, and off. Verified that the caches always
reflected the new settings, and that the results were what I expected.