GitShow/facebook/rules_pyrefly
facebook

rules_pyrefly

Bazel rules for running Pyrefly type checking over Python targets. Provides an aspect-based integration and Bzlmod toolchain extension for hermetic Pyrefly binary management.

by facebook
Star on GitHubFork

Starlark

5 stars2 forks1 contributorActive · 2w agoSince 2026v0.1.0Apache-2.0

Meet the team

See all 1 on GitHub →
grievejia
grievejia5 contributions

Languages

View on GitHub →
Starlark62.6%
Python37.4%

Commit activity

Last 12 weeks · 5 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 2w ago
See all on GitHub →
grievejia
Add target-local Pyrefly configuration through aspect_hintsOpenPR

Fixes #1 Summary add public and APIs support hint-based opt-in and suppression apply target-local preset, minimum severity, and per-error severity overrides document the precedence rules and exercise configurable behavior Testing @rickeylev, would you be willing to review this implementation?

grievejia · 2w ago
rickeylev
Support aspect_hints for tagging and configuring targetsOpenIssue

I was adding pyrefly checking to rules_python in https://github.com/bazel-contrib/rules_python/pull/4009 and was pleasantly surprised at how easy it was! Thanks for that! I saw the there is some basic configurability using tags, but IMHO, that isn't as ideal. aspect_hints are better. Why aspect_hints instead of tags? Two main reasons: (1) aspect_hints is a configurable attribute, while tags is not. This means you can use select() and only trigger type checking if certain conditions are met. This also means that, if a user wanted to, they could use much more arbitrary and custom analysis-phase logic for deciding if something should be type checked. (2) aspect hints return provides, which means its an easy way to pass along configuration settings to pyrefly. I noticed that the pyrefly aspect has a variety of settings one can tune, for example. Encoding these as e.g. tags would be pretty tedious and brittle. A bonus of (2) is it creates a loose coupling between rules and type checkers. Something I've fretted over is how the py_library et al rules in rules_python would provide type checker integration without being specific to a particular type checker. Aspect hints makes for a pretty easy way to attach that information while keeping the coupling loose. It looked like the changes to support this were fairly simple (basically just also looking at the visited target's aspect_hints attribute). I'd send a PR, but that entails some paper work due to $dayJob, and I hate paperwork, so not sure when, or if that'll happen.

rickeylev · 2w ago
Structured data for AI agents

Repository: facebook/rules_pyrefly. Description: Bazel rules for running Pyrefly type checking over Python targets. Provides an aspect-based integration and Bzlmod toolchain extension for hermetic Pyrefly binary management. Stars: 5, Forks: 2. Primary language: Starlark. Languages: Starlark (62.6%), Python (37.4%). License: Apache-2.0. Latest release: v0.1.0 (3w ago). Open PRs: 1, open issues: 1. Last activity: 2w ago. Community health: 75%. Top contributors: grievejia.

·@ofershap

Replace github.com with gitshow.dev