Skip to content

Commit 8ec73fc

Browse files
fix check-webkit-style errors in webkitpy about not having two spaces before inline comment
https://bugs.webkit.org/show_bug.cgi?id=171506 Reviewed by Alexey Proskuryakov. * Scripts/webkitpy/common/checkout/scm/scm_unittest.py: (SCMTest._shared_test_reverse_diff): Added two spaces before inline comment. (test_create_patch_is_full_patch): Ditto. * Scripts/webkitpy/common/thread/messagepump.py: (MessagePump): Ditto. * Scripts/webkitpy/layout_tests/servers/http_server.py: (Lighttpd._prepare_config): Ditto. * Scripts/webkitpy/style/checker.py: Ditto. * Scripts/webkitpy/style/checkers/cpp_unittest.py: (OrderOfIncludesTest.test_check_preprocessor_in_include_section): Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent cb803ae commit 8ec73fc

File tree

6 files changed

+49
-24
lines changed

6 files changed

+49
-24
lines changed

Tools/ChangeLog

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2017-11-07 Aakash Jain <[email protected]>
2+
3+
fix check-webkit-style errors in webkitpy about not having two spaces before inline comment
4+
https://bugs.webkit.org/show_bug.cgi?id=171506
5+
6+
Reviewed by Alexey Proskuryakov.
7+
8+
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
9+
(SCMTest._shared_test_reverse_diff): Added two spaces before inline comment.
10+
(test_create_patch_is_full_patch): Ditto.
11+
* Scripts/webkitpy/common/thread/messagepump.py:
12+
(MessagePump): Ditto.
13+
* Scripts/webkitpy/layout_tests/servers/http_server.py:
14+
(Lighttpd._prepare_config): Ditto.
15+
* Scripts/webkitpy/style/checker.py: Ditto.
16+
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
17+
(OrderOfIncludesTest.test_check_preprocessor_in_include_section): Ditto.
18+
119
2017-11-07 Aakash Jain <[email protected]>
220

321
Add support for webkitpy tests EWS

Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def _shared_test_committer_email_for_revision(self):
416416
self.assertEqual(self.scm.committer_email_for_revision(3), getpass.getuser()) # Committer "email" will be the current user
417417

418418
def _shared_test_reverse_diff(self):
419-
self._setup_webkittools_scripts_symlink(self.scm) # Git's apply_reverse_diff uses resolve-ChangeLogs
419+
self._setup_webkittools_scripts_symlink(self.scm) # Git's apply_reverse_diff uses resolve-ChangeLogs.
420420
# Only test the simple case, as any other will end up with conflict markers.
421421
self.scm.apply_reverse_diff('5')
422422
self.assertEqual(read_from_path('test_file'), "test1test2test3\n")
@@ -703,7 +703,7 @@ def test_create_patch_is_full_patch(self):
703703
# Change into our test directory and run the create_patch command.
704704
os.chdir(test_dir_path)
705705
scm = detect_scm_system(test_dir_path)
706-
self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
706+
self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
707707
actual_patch_contents = scm.create_patch()
708708
expected_patch_contents = """Index: test_dir2/test_file2
709709
===================================================================

Tools/Scripts/webkitpy/common/thread/messagepump.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def final_message_delivered(self):
3939

4040

4141
class MessagePump(object):
42-
interval = 10 # seconds
42+
interval = 10 # seconds.
4343

4444
def __init__(self, delegate, message_queue):
4545
self._delegate = delegate

Tools/Scripts/webkitpy/layout_tests/servers/http_server.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ def _prepare_config(self):
172172
'-m', module_path]
173173

174174
if not self._run_background:
175-
start_cmd.append(# Don't background
176-
'-D')
175+
start_cmd.append('-D') # Don't background.
177176

178177
# Copy liblightcomp.dylib to /tmp/lighttpd/lib to work around the
179178
# bug that mod_alias.so loads it from the hard coded path.

Tools/Scripts/webkitpy/style/checker.py

+23-15
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@
142142
os.path.join('Tools', 'DumpRenderTree', 'TestNetscapePlugIn')],
143143
["-build/include",
144144
"-readability/naming"]),
145-
([# There is no clean way to avoid "yy_*" names used by flex.
145+
([ # There is no clean way to avoid "yy_*" names used by flex.
146146
os.path.join('Source', 'WebCore', 'css', 'CSSParser.cpp'),
147147
# TestWebKitAPI uses funny macros like EXPECT_WK_STREQ.
148148
os.path.join('Tools', 'TestWebKitAPI')],
149149
["-readability/naming"]),
150150

151-
([# The GTK+ and WPE APIs use upper case, underscore separated, words in
151+
([
152+
# The GTK+ and WPE APIs use upper case, underscore separated, words in
152153
# certain types of enums (e.g. signals, properties).
153154
os.path.join('Source', 'WebKit', 'Shared', 'API', 'glib'),
154155
os.path.join('Source', 'WebKit', 'UIProcess', 'API', 'glib'),
@@ -159,31 +160,35 @@
159160
os.path.join('Source', 'WebKit', 'WebProcess', 'InjectedBundle', 'API', 'wpe')],
160161
["-readability/enum_casing"]),
161162

162-
([# To use GStreamer GL without conflicts of GL symbols,
163+
([
164+
# To use GStreamer GL without conflicts of GL symbols,
163165
# we should include gst/gl/gl.h before including OpenGL[ES]Shims
164166
os.path.join('Source', 'WebCore', 'platform', 'graphics', 'gstreamer', 'MediaPlayerPrivateGStreamerBase.cpp')],
165167
["-build/include_order"]),
166168

167-
([# Header files in ForwardingHeaders have no header guards or
169+
([
170+
# Header files in ForwardingHeaders have no header guards or
168171
# exceptional header guards (e.g., WebCore_FWD_Debugger_h).
169172
os.path.join(os.path.sep, 'ForwardingHeaders')],
170173
["-build/header_guard"]),
171-
([# assembler has lots of opcodes that use underscores, so
174+
([
175+
# Assembler has lots of opcodes that use underscores, so
172176
# we don't check for underscores in that directory.
173177
os.path.join('Source', 'JavaScriptCore', 'assembler'),
174178
os.path.join('Source', 'JavaScriptCore', 'jit', 'JIT')],
175179
["-readability/naming/underscores"]),
176-
([# JITStubs has an usual syntax which causes false alarms for a few checks.
180+
([ # JITStubs has an usual syntax which causes false alarms for a few checks.
177181
os.path.join('JavaScriptCore', 'jit', 'JITStubs.cpp')],
178182
["-readability/parameter_name",
179183
"-whitespace/parens"]),
180184

181185
# WebKit rules:
182186
# WebKit and certain directories have idiosyncracies.
183-
([# NPAPI has function names with underscores.
187+
([ # NPAPI has function names with underscores.
184188
os.path.join('Source', 'WebKit', 'WebProcess', 'Plugins', 'Netscape')],
185189
["-readability/naming"]),
186-
([# The WebKit C API has names with underscores and whitespace-aligned
190+
([
191+
# The WebKit C API has names with underscores and whitespace-aligned
187192
# struct members. Also, we allow unnecessary parameter names in
188193
# WebKit APIs because we're matching CF's header style.
189194
# Additionally, we use word which starts with non-capital letter 'k'
@@ -195,7 +200,8 @@
195200
"-readability/naming",
196201
"-readability/parameter_name",
197202
"-whitespace/declaration"]),
198-
([# These files define GObjects, which implies some definitions of
203+
([
204+
# These files define GObjects, which implies some definitions of
199205
# variables and functions containing underscores.
200206
os.path.join('Source', 'WebCore', 'platform', 'graphics', 'gstreamer', 'VideoSinkGStreamer.cpp'),
201207
os.path.join('Source', 'WebCore', 'platform', 'graphics', 'gstreamer', 'WebKitWebSourceGStreamer.cpp'),
@@ -220,31 +226,33 @@
220226
"+pep8/W291", # Trailing white space
221227
"+whitespace/carriage_return"]),
222228

223-
([# Source/JavaScriptCore/disassembler/udis86/ is generated code.
229+
([ # Source/JavaScriptCore/disassembler/udis86/ is generated code.
224230
os.path.join('Source', 'JavaScriptCore', 'disassembler', 'udis86')],
225231
["-readability/naming/underscores",
226232
"-whitespace/declaration",
227233
"-whitespace/indent"]),
228234

229-
([# There is no way to avoid the symbols __jit_debug_register_code
235+
([
236+
# There is no way to avoid the symbols __jit_debug_register_code
230237
# and __jit_debug_descriptor when integrating with gdb.
231238
os.path.join('Source', 'JavaScriptCore', 'jit', 'GDBInterface.cpp')],
232239
["-readability/naming"]),
233240

234-
([# On some systems the trailing CR is causing parser failure.
241+
([ # On some systems the trailing CR is causing parser failure.
235242
os.path.join('Source', 'JavaScriptCore', 'parser', 'Keywords.table')],
236243
["+whitespace/carriage_return"]),
237244

238-
([# DataDetectorsCoreSPI.h declares enum bitfields as CFIndex.
245+
([ # DataDetectorsCoreSPI.h declares enum bitfields as CFIndex.
239246
os.path.join('Source', 'WebCore', 'PAL', 'pal', 'spi', 'cocoa', 'DataDetectorsCoreSPI.h')],
240247
["-runtime/enum_bitfields"]),
241248

242-
([# PassKitSPI.h imports "PassKit.h" at two lines depending on the build configuration,
249+
([
250+
# PassKitSPI.h imports "PassKit.h" at two lines depending on the build configuration,
243251
# which causes a false positive error.
244252
os.path.join('Source', 'WebCore', 'PAL', 'pal', 'spi', 'cocoa', 'PassKitSPI.h')],
245253
["-build/include"]),
246254

247-
([# Some SPI headers have identifier names with underscores.
255+
([ # Some SPI headers have identifier names with underscores.
248256
os.path.join('Source', 'WebCore', 'PAL', 'pal', 'spi')],
249257
["-readability/naming/underscores"]),
250258
]

Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2878,7 +2878,7 @@ def test_check_preprocessor_in_include_section(self):
28782878
'#else\n'
28792879
'#include "foobar.h"\n'
28802880
'#endif"\n'
2881-
'#include "bar.h"\n', # No flag because previous is in preprocessor section
2881+
'#include "bar.h"\n', # No flag because previous is in preprocessor section.
28822882
'')
28832883

28842884
self.assert_language_rules_check('foo.cpp',
@@ -2889,7 +2889,7 @@ def test_check_preprocessor_in_include_section(self):
28892889
'#include "baz.h"\n'
28902890
'#endif"\n'
28912891
'#include "bar.h"\n'
2892-
'#include "a.h"\n', # Should still flag this.
2892+
'#include "a.h"\n', # Should still flag this.
28932893
'Alphabetical sorting problem. [build/include_order] [4]')
28942894

28952895
self.assert_language_rules_check('foo.cpp',
@@ -2898,7 +2898,7 @@ def test_check_preprocessor_in_include_section(self):
28982898
'\n'
28992899
'#ifdef BAZ\n'
29002900
'#include "baz.h"\n'
2901-
'#include "bar.h"\n' #Should still flag this
2901+
'#include "bar.h"\n' # Should still flag this.
29022902
'#endif"\n',
29032903
'Alphabetical sorting problem. [build/include_order] [4]')
29042904

@@ -2913,7 +2913,7 @@ def test_check_preprocessor_in_include_section(self):
29132913
'#include "foobar.h"\n'
29142914
'#endif"\n'
29152915
'#include "bar.h"\n'
2916-
'#include "a.h"\n', # Should still flag this.
2916+
'#include "a.h"\n', # Should still flag this.
29172917
'Alphabetical sorting problem. [build/include_order] [4]')
29182918

29192919
# Check that after an already included error, the sorting rules still work.

0 commit comments

Comments
 (0)