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

86 stars9 forks24 contributorsActive · 6h agoSince 2026MIT

Meet the team

See all 24 on GitHub →
brittanyrey
brittanyrey210 contributions
martindemello
martindemello101 contributions
alrobichaud
alrobichaud44 contributions
QuantumManiac
QuantumManiac4 contributions
msullivan
msullivan4 contributions
samwgoldman
samwgoldman4 contributions
dependabot[bot]Bot
dependabot[bot]4 contributions
czardoz
czardoz2 contributions

Languages

View on GitHub →
Python72.1%
Rust27.9%
Starlark0%

Commit activity

Last 12 weeks · 274 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 6h 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 · 3mo ago

Recent fixes

View closed PRs →
kevinprineet
Group verbose output by error typeMergedPR

Changes: Group errors by ErrorKind (using BTreeMap for consistent ordering) Sort errors within each group by line number Display the count of occurrences for each error type Example output: ImportedModuleAssignment (2) Line 12 - os Line 17 - sys UnsafeFunctionCall (1) Line 38 - example.demo.unsafe_method Benefits: Easier to scan large reports and identify patterns Highlights the most common issue categories Does not change the underlying analysis Backward compatible with existing analysis logic Testing: Updated existing tests to verify grouped output Added comprehensive test for grouping and sorting behavior

kevinprineet · 2w ago
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 · 4mo 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 · 4mo 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: 86, Forks: 9. Primary language: Python. Languages: Python (72.1%), Rust (27.9%), Starlark (0%). License: MIT. Topics: lazy-imports, pep810, python, rust, static-analysis. Open PRs: 1, open issues: 0. Last activity: 6h ago. Community health: 75%. Top contributors: brittanyrey, martindemello, alrobichaud, QuantumManiac, msullivan, samwgoldman, dependabot[bot], czardoz, alexmalyshev, kuecks and others.

·@ofershap

Replace github.com with gitshow.dev