From 82714e08a1c21885484ea210d543a12acd8b7e07 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 4 May 2018 11:33:32 +0200 Subject: [PATCH] Get a real parser, tidy --- python/tidy/servo_tidy/tidy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 1dcdfd17849..9208727cbb3 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -398,7 +398,8 @@ def check_toml(file_name, lines): for idx, line in enumerate(lines): if idx == 0 and "[workspace]" in line: raise StopIteration - if line.find("*") != -1: + line_without_comment, _, _ = line.partition("#") + if line_without_comment.find("*") != -1: yield (idx + 1, "found asterisk instead of minimum version number") for license_line in licenses_toml: ok_licensed |= (license_line in line)