-
| 
         Let's suppose that we have the following code: scripts.pydef get_google_info():
    return requests.get("https://google.com").status_code
if __name__ == '__main__':
    import requests
    print(get_google_info())running ruff (version: 0.9.7) would return me no errors to that code (All checks passed! message). But, this code will actually not execute, if it's used by someplace else with no requests reference. Ex: main.pyfrom scripts import get_google_info
if __name__ == '__main__':
    print(get_google_info())So, if i run: Do you have any idea how could i use static check to avoid these errors?  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
| 
         ruff is currently restricted to single-file analysis. Handling this example will require the multi-file analysis and type inference that we're working on in red-knot.  | 
  
Beta Was this translation helpful? Give feedback.
ruff is currently restricted to single-file analysis. Handling this example will require the multi-file analysis and type inference that we're working on in red-knot.