)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"bb04ec8cdf55a4648ba61d601b9c311d75e0bf01","unresolved":false,"context_lines":[{"line_number":10,"context_line":"whitelisting imports in certain files."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"The returned function can be registered as a pep8 check, and expects to"},{"line_number":13,"context_line":"be passed the code to be used for the rule, a file to consider, and"},{"line_number":14,"context_line":"whitelists of stdlib, 3rd party and project modules."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Unit tests that are part of this patch give an example of how this can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7a016987_725c6ced","line":13,"updated":"2015-05-16 21:01:36.000000000","message":"Could you also provide a justification for this? I\u0027m not sure I\u0027ve seen a use case for this kind of check before.","commit_id":"54f91da060ad5090cccf6afa4b29fbe88f029417"}],"hacking/checks/imports.py":[{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"52bc97bfa142a6229b556b99d534187ebc3dfaf1","unresolved":false,"context_lines":[{"line_number":313,"context_line":"def whitelist_imports_in_file_factory(check_code, file_path, stdlib_whitelist,"},{"line_number":314,"context_line":"                                      pip_whitelist, project_whitelist):"},{"line_number":315,"context_line":"    \"\"\"Generate a check that will enforce import whitelists for file_path"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    :param check_code: The rule number of the created check"},{"line_number":318,"context_line":"    :param file_path: File path for the file to check, if it\u0027s a directory,"},{"line_number":319,"context_line":"            all files will be checked"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_e4a614c1","line":316,"updated":"2014-05-01 00:49:05.000000000","message":"Can you add a section on how to use this, or perhaps a comment saying that this exists in README.rst under Local Checks.\n\n(-1 for this)","commit_id":"54f91da060ad5090cccf6afa4b29fbe88f029417"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"52bc97bfa142a6229b556b99d534187ebc3dfaf1","unresolved":false,"context_lines":[{"line_number":318,"context_line":"    :param file_path: File path for the file to check, if it\u0027s a directory,"},{"line_number":319,"context_line":"            all files will be checked"},{"line_number":320,"context_line":"    :param stdlib_whitelist: \"all\" or a list of stdlib modules to allow"},{"line_number":321,"context_line":"    :param pip_whitelist: \"all\" or a list of 3rd pary modules to allow"},{"line_number":322,"context_line":"    :param project_whitelist: \"all\" or a list of modules from the same project"},{"line_number":323,"context_line":"            to allow"},{"line_number":324,"context_line":"    :return:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_049a1863","line":321,"updated":"2014-05-01 00:49:05.000000000","message":"What about having default values for these? default to \"all\"\n\nAlso thoughts on generalizing this to produce whitelists and blacklists?\n\nWe have some blacklist requirements on nova (nova.db in compute)","commit_id":"54f91da060ad5090cccf6afa4b29fbe88f029417"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"bb04ec8cdf55a4648ba61d601b9c311d75e0bf01","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                import_type \u003d _get_import_type(module)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"                if import_type \u003d\u003d \u0027stdlib\u0027:"},{"line_number":345,"context_line":"                    if stdlib_whitelist !\u003d \"all\":"},{"line_number":346,"context_line":"                        if module not in stdlib_whitelist:"},{"line_number":347,"context_line":"                            if package not in stdlib_whitelist:"},{"line_number":348,"context_line":"                                format_dict[\u0027line\u0027] \u003d import_line"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_5274d066","line":345,"updated":"2015-05-16 21:01:36.000000000","message":"Couldn\u0027t these conditionals all be in a single if-statement?\n\n    if (import_type \u003d\u003d \u0027stdlib\u0027 and stdlib_whitelist !\u003d \u0027all\u0027 and\n           module not in stdlib_whitelist and package not in stdlib_whitelist):\n\nThis could be done for all of the if statements like this","commit_id":"54f91da060ad5090cccf6afa4b29fbe88f029417"}],"hacking/core.py":[{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"73f3a857d6281511de3b0800076b15e71d13f33d","unresolved":false,"context_lines":[{"line_number":641,"context_line":"                import_type \u003d _get_import_type(module)"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"                if import_type \u003d\u003d \u0027stdlib\u0027:"},{"line_number":644,"context_line":"                    if stdlib_whitelist !\u003d \"all\":"},{"line_number":645,"context_line":"                        if module not in stdlib_whitelist:"},{"line_number":646,"context_line":"                            if package not in stdlib_whitelist:"},{"line_number":647,"context_line":"                                format_dict[\u0027line\u0027] \u003d import_line"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXH%2F%2FbvA%3D","line":644,"updated":"2014-04-21 20:37:22.000000000","message":"why not blacklist?","commit_id":"f417d8dcafb82d43dad8e5972b48657aa3abaac6"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"77c3903ec58efa2f3dfacacfdb57ff574925a417","unresolved":false,"context_lines":[{"line_number":641,"context_line":"                import_type \u003d _get_import_type(module)"},{"line_number":642,"context_line":""},{"line_number":643,"context_line":"                if import_type \u003d\u003d \u0027stdlib\u0027:"},{"line_number":644,"context_line":"                    if stdlib_whitelist !\u003d \"all\":"},{"line_number":645,"context_line":"                        if module not in stdlib_whitelist:"},{"line_number":646,"context_line":"                            if package not in stdlib_whitelist:"},{"line_number":647,"context_line":"                                format_dict[\u0027line\u0027] \u003d import_line"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAXX%2F%2F8IU%3D","line":644,"in_reply_to":"AAAAXH%2F%2FbvA%3D","updated":"2014-04-25 07:10:32.000000000","message":"right - that\u0027s a good question, really depending on the usecase you might want to use either or. the usecase I had in mind requires whitelists (see https://review.openstack.org/#/c/57009/).\n\nI\u0027d say that if someone needs to do this but with blacklists, they can implement a second check and probably re-use a bunch of code here. but for now I don\u0027t think we need to block it on this only.","commit_id":"f417d8dcafb82d43dad8e5972b48657aa3abaac6"}]}
