diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 7195cf004d..ae811ab518 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -140,11 +140,13 @@ def build_custom_checkers(by_lang): 'description': 'The module blueslip has no function warning, try using blueslip.warn'}, {'pattern': '[)]{$', 'description': 'Missing space between ) and {'}, - {'pattern': 'i18n\.t\([^)]+[^,\{]$', + {'pattern': 'i18n\.t\([^)]+[^,\{\)]$', 'description': 'i18n string should not be a multiline string'}, - {'pattern': 'i18n\.t([^)]+?\+.+?)', + {'pattern': 'i18n\.t\([\'\"].+?[\'\"]\s*\+', + 'description': 'Do not concatenate arguments within i18n.t()'}, + {'pattern': 'i18n\.t\(.+\).*\+', 'description': 'Do not concatenate i18n strings'}, - {'pattern': 'i18n\.t([^+]+?).+?\+', + {'pattern': '\+.*i18n\.t\(.+\)', 'description': 'Do not concatenate i18n strings'}, {'pattern': '["\']json/', 'description': 'Relative URL for JSON route not supported by i18n'},