Commit Graph

12 Commits

Author SHA1 Message Date
Steve Howell
1e5ec689b7 tools/css: Trim whitespace around CSS values. 2017-03-14 09:29:56 -07:00
Steve Howell
2ffea94bd8 tools/css: Require semicolons after CSS declarations. 2017-03-14 09:29:56 -07:00
Tim Abbott
473c0ee1fe mypy: Remove now-unused type: ignores. 2017-02-18 17:01:01 -08:00
Steve Howell
2a07b204bf css parser: Show line numbers for errors.
This is a fairly major overhaul of the CSS parser to support
line numbers in error messages.

Basically, instead of passing "slices" of tokens around, we pass
indexes into the token arrays to all of our sub-parsers, which
allows them to have access to previous tokens in certain cases.
This is particularly important for errors where stuff is missing
(vs. being wrong).

In testing this out I found a few more places to catch errors.
2017-02-01 10:02:03 -08:00
Sampriti Panda
c0326d1938 Add lint rule to disallow python calls with versions (e.g: python2, python3)
Fixes #2435
2016-12-19 08:00:48 -08:00
Tomasz Kolek
34511065dc Fix tests problem with backward incompatible function name.
Add __init__ methods to some of testing clases with overriding method name.
2016-12-16 07:04:55 -08:00
Tim Abbott
bf80873d4f tests: s/assertRaisesRegexp/assertRaisesRegex/ due to deprecation. 2016-12-15 17:11:42 -08:00
Sahil Dua
058587da77 Remove extra new lines at the ends of Zulip authoried files.
Fixes #1627.

[tweaked by tabbott to avoid patching third-party modules, for now]
2016-09-26 21:05:24 -07:00
Steve Howell
28bb9c883a css linter: Report empty declarations more clearly.
Raise a CssParserException when declarations are empty.
2016-09-23 09:13:43 -07:00
Tim Abbott
1eb16d03a2 Finish annotating template/css parsers and tests. 2016-09-12 09:03:50 -07:00
Gordon P. Hemsley
87b87621fe Reach 100% branch coverage for CSS parser. 2016-09-11 09:59:13 -07:00
Steve Howell
7cc1b1ebc4 Add test coverage for parsers in tools/lib.
Now, `tools/test-all` calls a new program called `tools/tests-tools`
that runs unit tests in `test_css_parser.py` and 'test_template_parser.py`.

This puts 100% line coverage on tools/lib/css_parser.py.
This puts about 50% line coverage on tools/lib/template_parser.py.
2016-08-04 10:47:09 -07:00