zulip/tools/linter_lib
Umair Khan df70fa962e linter: Improve i18n related regexes.
There are four regexes which try to ensure that the i18n strings are
properly captured.

1) The one which disallows multiline strings.
```
i18n\.t\([^)]+[^,\{\)]$

// Disallows:
i18n.t('some '
       + 'text');
```

2) The one which disallows concatenation within argument to i18n.t():
```
i18n\.t\([\'\"].+?[\'\"]\s*\+

// Disallows:
i18n.t("some " + "text");
```

3) There are two which disallow concatenation with i18n.t():
```
i18n\.t\(.+\).*\+

// Disallows:
i18n.t('some text') +

\+.*i18n\.t\(.+\)

// Disallows:
+ i18n.t('some text')
```

The ideal case is that you try to bring the string argument to the
i18n.t() on one line. In case this is not possible, you can do the
following:

```
var1 = i18n.t("Some text to be translated");
var2 = i18n.t("Some more text to be translated");
complete = var1 + var2;
2017-09-13 12:58:27 -07:00
..
__init__.py Extract tools/linter_lib/custom_check.py. 2017-06-05 09:20:21 -07:00
custom_check.py linter: Improve i18n related regexes. 2017-09-13 12:58:27 -07:00
exclude.py api: Update lint and analysis code to forget about now-gone files. 2017-07-31 21:24:52 -07:00
pep8.py mypy: Add assertions relating to Popen.stdout with subprocess.PIPE use. 2017-08-07 21:27:50 -07:00
printer.py linter: Create error printing library. 2017-07-06 13:46:10 +08:00
pyflakes.py lint: Fix problematic merging of pyflakes stdout/stderr. 2017-08-29 10:44:50 -07:00