[Webkit-unassigned] [Bug 32597] Check one space before end of line comments

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 17 08:28:55 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32597





--- Comment #13 from Shinichiro Hamaji <hamaji at chromium.org>  2009-12-17 08:28:54 PST ---
(From update of attachment 45043)
Some comments... First of all, indent level should be 4, not 2.

> @@ -874,8 +872,7 @@ def get_header_guard_cpp_variable(filename):
>  
>      """
>  
> -    fileinfo = FileInfo(filename)
> -    return sub(r'[-./\s]', '_', fileinfo.repository_name()).upper() + '_'
> +    return sub(r'[-./\s]', '_', os.path.basename(filename))

We don't need to replace '/' anymore?

> @@ -1362,31 +1363,6 @@ class CppStyleTest(CppStyleTestBase):
>          self.assert_multi_line_lint('#endif\n    );',
>                                      '')
>  
> -    def test_two_spaces_between_code_and_comments(self):
> -        self.assert_lint('} // namespace foo',
> -                         'At least two spaces is best between code and comments'
> -                         '  [whitespace/comments] [2]')
> -        self.assert_lint('}// namespace foo',
> -                         'At least two spaces is best between code and comments'
> -                         '  [whitespace/comments] [2]')
> -        self.assert_lint('printf("foo"); // Outside quotes.',
> -                         'At least two spaces is best between code and comments'
> -                         '  [whitespace/comments] [2]')
> -        self.assert_lint('int i = 0;  // Having two spaces is fine.', '')
> -        self.assert_lint('int i = 0;   // Having three spaces is OK.', '')
> -        self.assert_lint('// Top level comment', '')
> -        self.assert_lint('    // Line starts with four spaces.', '')
> -        self.assert_lint('foo();\n'
> -                         '{ // A scope is opening.', '')
> -        self.assert_lint('    foo();\n'
> -                         '    { // An indented scope is opening.', '')
> -        self.assert_lint('if (foo) { // not a pure scope; comment is too close!',
> -                         'At least two spaces is best between code and comments'
> -                         '  [whitespace/comments] [2]')
> -        self.assert_lint('printf("// In quotes.")', '')
> -        self.assert_lint('printf("\\"%s // In quotes.")', '')
> -        self.assert_lint('printf("%s", "// In quotes.")', '')
> -

I don't want to remove this test. They look good. Especially, I think we want
to have a testcase for a comment in a string literal.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list