)]}'
{"cinder/hacking/checks.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"0107e6508b339c79cfe019c43a0dc07a89f181da","unresolved":false,"context_lines":[{"line_number":43,"context_line":"# We need this for cases where they have created their own _ function."},{"line_number":44,"context_line":"custom_underscore_check \u003d re.compile(r\"(.)*_\\s*\u003d\\s*(.)*\")"},{"line_number":45,"context_line":"no_audit_log \u003d re.compile(r\"(.)*LOG\\.audit(.)*\")"},{"line_number":46,"context_line":"no_print_statements \u003d re.compile(r\"\\s*print\\(.+\\).*\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"# NOTE(jsbryant): When other oslo libraries switch over non-namespaced"},{"line_number":49,"context_line":"# imports, we will need to add them to the regex below."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6ced46_94949b38","line":46,"updated":"2015-03-23 11:28:07.000000000","message":"I think it is possible spaces before parentheses \"print     (\u0027string\u0027)\". Also what do you think about print statement support, like \"print  \u0027string\u0027 ?","commit_id":"95819f9fac3f1c31ac07d01b33c04d643b3267cd"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"6cbc6b441954d704ddbeaa9558af6782b9a31be0","unresolved":false,"context_lines":[{"line_number":43,"context_line":"# We need this for cases where they have created their own _ function."},{"line_number":44,"context_line":"custom_underscore_check \u003d re.compile(r\"(.)*_\\s*\u003d\\s*(.)*\")"},{"line_number":45,"context_line":"no_audit_log \u003d re.compile(r\"(.)*LOG\\.audit(.)*\")"},{"line_number":46,"context_line":"no_print_statements \u003d re.compile(r\"\\s*print\\(.+\\).*\")"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"# NOTE(jsbryant): When other oslo libraries switch over non-namespaced"},{"line_number":49,"context_line":"# imports, we will need to add them to the regex below."}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_4bc1082e","line":46,"in_reply_to":"1a6ced46_94949b38","updated":"2015-04-06 16:23:48.000000000","message":"Done","commit_id":"95819f9fac3f1c31ac07d01b33c04d643b3267cd"},{"author":{"_account_id":14271,"name":"Kallebe Monteiro","email":"kallebe.monteiro@lsbd.ufc.br","username":"kallebe"},"change_message_id":"970aafe3237fa863c57f8762a6d9c50a66601098","unresolved":false,"context_lines":[{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"def check_no_print_statements(logical_line, filename):"},{"line_number":276,"context_line":"    if (\u0027cinder/cmd\u0027 not in filename and"},{"line_number":277,"context_line":"            \"cinder/wsgi.py\" not in filename and"},{"line_number":278,"context_line":"            \"test_hds_hnas_backend.py\" not in filename):"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_efab7585","line":276,"updated":"2015-03-20 18:53:51.000000000","message":"About this check, this way is not much \"scalable\" if in the future more files would be ignored in this hacking check.\n\nI was wondering if it would be better as:\n\nignored_list \u003d [\u0027cinder/cmd\u0027, \u0027cinder/wsgi.py\u0027, \u0027test_hds_hnas_backend.py\u0027]\ncontains \u003d lambda ignored: ignored in filename\nif any(map(contains, ignored_list)):\n    pass\nelse:\n    # do the re check\n\nIt would be easier if in the future someone wants to add one more ignored file or directory.","commit_id":"95819f9fac3f1c31ac07d01b33c04d643b3267cd"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"6cbc6b441954d704ddbeaa9558af6782b9a31be0","unresolved":false,"context_lines":[{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"def check_no_print_statements(logical_line, filename):"},{"line_number":276,"context_line":"    if (\u0027cinder/cmd\u0027 not in filename and"},{"line_number":277,"context_line":"            \"cinder/wsgi.py\" not in filename and"},{"line_number":278,"context_line":"            \"test_hds_hnas_backend.py\" not in filename):"},{"line_number":279,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_7ea00891","line":276,"in_reply_to":"9a80dd14_efab7585","updated":"2015-04-06 16:23:48.000000000","message":"Done","commit_id":"95819f9fac3f1c31ac07d01b33c04d643b3267cd"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"4968cc8eb4b8daad7640615d6c71d1cfbb620aa7","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# NOTE(jsbryant): Some files in Cinder legitimately use print() in their code."},{"line_number":36,"context_line":"#                 Those files can be listed here so they do not fail C303."},{"line_number":37,"context_line":"NO_PRINT_IGNORE_LIST \u003d [\u0027cinder/cmd\u0027, \u0027cinder/wsgi.py\u0027,"},{"line_number":38,"context_line":"                        \u0027test_hds_hnas_backend.py\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"translated_log \u003d re.compile("},{"line_number":41,"context_line":"    r\"(.)*LOG\\.(audit|error|info|warn|warning|critical|exception)\""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_7276f93f","line":38,"updated":"2015-04-06 17:36:14.000000000","message":"Would it be better for specific files outside the cinder/cmd directory to use noqa?","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0fac2eb94b3cf10fa3b8d0be774ce3505f889446","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# NOTE(jsbryant): Some files in Cinder legitimately use print() in their code."},{"line_number":36,"context_line":"#                 Those files can be listed here so they do not fail C303."},{"line_number":37,"context_line":"NO_PRINT_IGNORE_LIST \u003d [\u0027cinder/cmd\u0027, \u0027cinder/wsgi.py\u0027,"},{"line_number":38,"context_line":"                        \u0027test_hds_hnas_backend.py\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"translated_log \u003d re.compile("},{"line_number":41,"context_line":"    r\"(.)*LOG\\.(audit|error|info|warn|warning|critical|exception)\""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_1f9fa404","line":38,"in_reply_to":"9aa53dc9_4e1d8472","updated":"2015-04-07 06:03:20.000000000","message":"+1 for noqa in test_hds_hnas_backend.py.","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"5d4ed777659cf80157ce2fcce39a377742b1f14e","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# NOTE(jsbryant): Some files in Cinder legitimately use print() in their code."},{"line_number":36,"context_line":"#                 Those files can be listed here so they do not fail C303."},{"line_number":37,"context_line":"NO_PRINT_IGNORE_LIST \u003d [\u0027cinder/cmd\u0027, \u0027cinder/wsgi.py\u0027,"},{"line_number":38,"context_line":"                        \u0027test_hds_hnas_backend.py\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"translated_log \u003d re.compile("},{"line_number":41,"context_line":"    r\"(.)*LOG\\.(audit|error|info|warn|warning|critical|exception)\""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_c0dedc6c","line":38,"in_reply_to":"9aa53dc9_4e1d8472","updated":"2015-04-07 19:40:12.000000000","message":"Done","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"0847f0a94f706191976948b82d155640cbe6ebf4","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# NOTE(jsbryant): Some files in Cinder legitimately use print() in their code."},{"line_number":36,"context_line":"#                 Those files can be listed here so they do not fail C303."},{"line_number":37,"context_line":"NO_PRINT_IGNORE_LIST \u003d [\u0027cinder/cmd\u0027, \u0027cinder/wsgi.py\u0027,"},{"line_number":38,"context_line":"                        \u0027test_hds_hnas_backend.py\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"translated_log \u003d re.compile("},{"line_number":41,"context_line":"    r\"(.)*LOG\\.(audit|error|info|warn|warning|critical|exception)\""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_4e1d8472","line":38,"in_reply_to":"9aa53dc9_6d817c8f","updated":"2015-04-07 03:53:16.000000000","message":"I think Sean\u0027s comments make sense. There are those one-off cases where it may be better just to use noqa as needed. Once a file is added to this ignore list, people tend to forget to remove from this list even if it doesn\u0027t need to be ignored any more. For example, code in  test_hds_hnas_backend.py that uses \u0027print\u0027 could be changed not to use \u0027print\u0027 at some point and it is very likely the person who makes that change won\u0027t know it should be removed from this ignore list.\n\nSo I think it is better to use noqa for test_hds_hnas_backend.py.","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"fee21bcda777920d5a339c44587c03eb3130efd4","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# NOTE(jsbryant): Some files in Cinder legitimately use print() in their code."},{"line_number":36,"context_line":"#                 Those files can be listed here so they do not fail C303."},{"line_number":37,"context_line":"NO_PRINT_IGNORE_LIST \u003d [\u0027cinder/cmd\u0027, \u0027cinder/wsgi.py\u0027,"},{"line_number":38,"context_line":"                        \u0027test_hds_hnas_backend.py\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"translated_log \u003d re.compile("},{"line_number":41,"context_line":"    r\"(.)*LOG\\.(audit|error|info|warn|warning|critical|exception)\""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_6d817c8f","line":38,"in_reply_to":"9aa53dc9_7276f93f","updated":"2015-04-06 18:19:25.000000000","message":"I was wondering about that as well, but at the same time didn\u0027t feel good about have one solution for cinder/cmd files and another for other files.  I am open to the idea though.","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0fac2eb94b3cf10fa3b8d0be774ce3505f889446","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    else:"},{"line_number":221,"context_line":"        if re.match(no_print_statements, logical_line):"},{"line_number":222,"context_line":"            msg \u003d (\"C303: print() should not be used. \""},{"line_number":223,"context_line":"                   \"Please use LOG.[info|error|warning|exception].\")"},{"line_number":224,"context_line":"            yield(0, msg)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_1f6d6404","line":223,"updated":"2015-04-07 06:03:20.000000000","message":"debug is missing.","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"5d4ed777659cf80157ce2fcce39a377742b1f14e","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    else:"},{"line_number":221,"context_line":"        if re.match(no_print_statements, logical_line):"},{"line_number":222,"context_line":"            msg \u003d (\"C303: print() should not be used. \""},{"line_number":223,"context_line":"                   \"Please use LOG.[info|error|warning|exception].\")"},{"line_number":224,"context_line":"            yield(0, msg)"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9aa53dc9_e0cd60b8","line":223,"in_reply_to":"9aa53dc9_1f6d6404","updated":"2015-04-07 19:40:12.000000000","message":"Done","commit_id":"21e1eda039836823c4eddd5a7b0ed0b292a772d4"}],"cinder/tests/test_hacking.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"368eb5fad34b9765c3e99900c8a979921b678883","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        self.assertEqual(0, len(list(checks.check_no_print_statements("},{"line_number":225,"context_line":"            \"print(\u0027My print statement\u0027)\","},{"line_number":226,"context_line":"            \"cinder/cmd/file.py\"))))"},{"line_number":227,"context_line":"        self.assertEqual(0, len(list(checks.check_no_print_statements("},{"line_number":228,"context_line":"            \"a line with no print statement\","},{"line_number":229,"context_line":"            \"cinder/cmd/file.py\"))))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_dadbc8ea","line":227,"updated":"2015-03-20 21:43:12.000000000","message":"This last one is a little redundant since it will exercise the same code path as the previous one. Certainly doesn\u0027t hurt though, and I suppose if the check code changes at all this could help ensure something doesn\u0027t get through the cracks.","commit_id":"95819f9fac3f1c31ac07d01b33c04d643b3267cd"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"6cbc6b441954d704ddbeaa9558af6782b9a31be0","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        self.assertEqual(0, len(list(checks.check_no_print_statements("},{"line_number":225,"context_line":"            \"print(\u0027My print statement\u0027)\","},{"line_number":226,"context_line":"            \"cinder/cmd/file.py\"))))"},{"line_number":227,"context_line":"        self.assertEqual(0, len(list(checks.check_no_print_statements("},{"line_number":228,"context_line":"            \"a line with no print statement\","},{"line_number":229,"context_line":"            \"cinder/cmd/file.py\"))))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9aa53dc9_bed570ba","line":227,"in_reply_to":"9a80dd14_dadbc8ea","updated":"2015-04-06 16:23:48.000000000","message":"Done.  Changed it to a test case for a \u0027print ( )\u0027 statement.","commit_id":"95819f9fac3f1c31ac07d01b33c04d643b3267cd"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"53485c3111b0ac16e1d39cca1ff85eaabbca096a","unresolved":false,"context_lines":[{"line_number":225,"context_line":"            \"cinder/tests/file.py\", True))))"},{"line_number":226,"context_line":"        self.assertEqual(1, len(list(checks.check_no_print_statements("},{"line_number":227,"context_line":"            \"print (\u0027My print with space\u0027)\","},{"line_number":228,"context_line":"            \"cinder/volume/anotherFile.py\", False))))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aa53dc9_2372204a","line":228,"updated":"2015-04-08 07:30:12.000000000","message":"Being the paranoid sort, I\u0027d check that the following don\u0027t get caught erroniously:\ndef print(self, msg):\nself.print(\"foo\")\nsome_long_method_ending_in_print(\"foo\")\n\nAnd that print statements with complex or none-int args get caught:\nprint(\"foo\", \"bar\", \"baz\", 123)\nprint(123)\nprint(foo)\n\nNo reason to think they won\u0027t, just doing my bit to encourage paranoia in unit tests. I\u0027ll submit a follow-up patch with these in to collect opinions.","commit_id":"c2658d9c09d9960d6028e9685fe0baa6c50d0f54"}]}
