44 """ |
44 """ |
45 httpVerbs = ("get", "options", "head", "post", "put", "patch", "delete") |
45 httpVerbs = ("get", "options", "head", "post", "put", "patch", "delete") |
46 httpxAttrs = ("request", "stream", "Client", "AsyncClient") + httpVerbs |
46 httpxAttrs = ("request", "stream", "Client", "AsyncClient") + httpVerbs |
47 qualName = context.callFunctionNameQual.split(".")[0] |
47 qualName = context.callFunctionNameQual.split(".")[0] |
48 if ( |
48 if ( |
49 ( |
49 (qualName == "requests" and context.callFunctionName in httpVerbs) |
50 ( |
50 or (qualName == "httpx" and context.callFunctionName in httpxAttrs) |
51 qualName == "requests" |
51 ) and context.checkCallArgValue("verify", "False"): |
52 and context.callFunctionName in httpVerbs |
|
53 ) |
|
54 or ( |
|
55 qualName == "httpx" |
|
56 and context.callFunctionName in httpxAttrs |
|
57 ) |
|
58 ) |
|
59 and context.checkCallArgValue("verify", "False") |
|
60 ): |
|
61 reportError( |
52 reportError( |
62 context.getLinenoForCallArg("verify") - 1, |
53 context.getLinenoForCallArg("verify") - 1, |
63 context.getOffsetForCallArg("verify"), |
54 context.getOffsetForCallArg("verify"), |
64 "S501", |
55 "S501", |
65 "H", |
56 "H", |