GitShow/facebook/Lifeguard
facebook

Lifeguard

Lifeguard is a static analyzer to detect Lazy Imports incompatibilities and ease the adoption overhead for Lazy Imports in Python

by facebook
lazy-importspep810pythonruststatic-analysis
Star on GitHubFork

Python

76 stars6 forks18 contributorsActive · 15h agoSince 2026MIT

Meet the team

See all 18 on GitHub →
brittanyrey
brittanyrey142 contributions
martindemello
martindemello57 contributions
alrobichaud
alrobichaud27 contributions
QuantumManiac
QuantumManiac4 contributions
msullivan
msullivan4 contributions
czardoz
czardoz2 contributions
samwgoldman
samwgoldman2 contributions
alexmalyshev
alexmalyshev1 contribution

Languages

View on GitHub →
Python76.7%
Rust23.3%

Commit activity

Last 12 weeks · 233 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
75
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 1 in progress · Last activity 15h ago
See all on GitHub →
msullivan
Follow re-export chains when checking call safetyOpenPR

Re-exported symbols (e.g. bar.Foo re-exporting foo.Foo) were not being resolved to their original definitions during safety analysis. This caused check_call to miss unsafe constructors/functions accessed through re-exports, incorrectly marking them as safe. Make the re_exports more visible to the main analysis, and resolve them when needed. I'm not totally happy with this approach, though, because it's would be easy to miss new places that a reexport needs to be chased down. I'll do a bit more thinking, but I'd be interested in architectural suggestions from the team.

msullivan · 1mo ago

Recent fixes

View closed PRs →
msullivan
Follow relative imports in site_packages in gen_source_dbMergedPR

When processing modules in site_packages, track the current package and use that to resolve relative imports. We don't bother doing this for packages in the project because they are currently all collected.

msullivan · 2mo ago
msullivan
Add tests for find_sources, gen-source-db, run-treeMergedPR

Most of the tests test the shared find_sources code directly, but also add a smoke test each for run-tree and gen-source-db that verify they are both supporting site-packages.

msullivan · 2mo ago
msullivan
Reuse the gen-source-db discovery machinery for run-treeMergedPR

I'm not totally sure if you want this, but it will let me start using run-tree instead of doing a separate gen-source-db + run step. In addition to reducing duplication, this gives run-tree access to site-packages.

msullivan · 2mo ago
Structured data for AI agents

Repository: facebook/Lifeguard. Description: Lifeguard is a static analyzer to detect Lazy Imports incompatibilities and ease the adoption overhead for Lazy Imports in Python Stars: 76, Forks: 6. Primary language: Python. Languages: Python (76.7%), Rust (23.3%). License: MIT. Topics: lazy-imports, pep810, python, rust, static-analysis. Open PRs: 1, open issues: 0. Last activity: 15h ago. Community health: 75%. Top contributors: brittanyrey, martindemello, alrobichaud, QuantumManiac, msullivan, czardoz, samwgoldman, alexmalyshev, kuecks, JakobDegen and others.

·@ofershap

Replace github.com with gitshow.dev