Skip to content

Commit 7ae10ae

Browse files
Merge branch 'main' into 2224
2 parents 3b6b011 + bbdcb2a commit 7ae10ae

File tree

1,455 files changed

+141352
-22437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,455 files changed

+141352
-22437
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ DJANGO_TEST_PATH = { value = "pyrefly/lib/test/django/third-party", relative = t
66
ATTRS_TEST_PATH = { value = "pyrefly/lib/test/attrs/third-party", relative = true }
77
MARSHMALLOW_TEST_PATH = { value = "pyrefly/lib/test/marshmallow/third-party", relative = true }
88
GLEAN_SNAPSHOTS_PATH = { value = "pyrefly/lib/report/glean/snapshots", relative = true }
9+
REPORT_TEST_PATH = { value = "pyrefly/lib/test/report/test_files", relative = true }
10+
STUBGEN_TEST_PATH = { value = "pyrefly/lib/test/stubgen", relative = true }
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
name: review-pyrefly-diff
3+
description: Reviews a comma separated pyrefly diff according to the pyrefly review best practices.
4+
---
5+
6+
This skill is intended to be used by interal Meta employees to review code changes in phabricator. This should not be used to review Github pull requests.
7+
8+
You will take in a comma separated list of Phabricator Diff numbers and review them according to the pyrefly review best practices. For each diff that is passed in, use a new subagent to perform the review in parallel.
9+
10+
# Code Review Guidelines for Pyrefly
11+
12+
You are reviewing a Phabricator Diff for Pyrefly, a fast language server and type checker for Python written in Rust.
13+
14+
## Review Focus Areas
15+
16+
### Correctness
17+
- Logic errors and edge cases
18+
- Null/None/Option handling
19+
- Off-by-one errors
20+
- Resource leaks or missing cleanup
21+
- Incorrect error handling
22+
23+
### Security
24+
- Input validation issues
25+
- Injection risks (command injection, path traversal)
26+
- Unsafe deserialization
27+
- Authentication/authorization gaps
28+
29+
### Performance
30+
- N+1 patterns or unnecessary iterations
31+
- Excessive allocations or cloning
32+
- Blocking operations in async contexts
33+
- Missing caching opportunities for expensive operations
34+
35+
### Testing
36+
- Missing test coverage for new functionality
37+
- Edge cases not covered by tests
38+
- Flaky test patterns
39+
40+
### Style and Consistency
41+
- Naming conventions (Rust: snake_case for functions, CamelCase for types)
42+
- Consistency with existing codebase patterns
43+
- Unnecessary complexity or over-engineering
44+
- Check for missed opportunities for code reuse
45+
46+
### Architecture
47+
- Separation of concerns
48+
- Tight coupling between components
49+
- Breaking changes to public APIs
50+
51+
## Pyrefly-Specific Guidelines
52+
53+
### Rust Conventions
54+
- Prefer `impl Trait` over `dyn Trait` where possible
55+
- Use `?` for error propagation instead of manual matching
56+
- Avoid `.unwrap()` in production code; prefer `.expect()` with context or proper error handling
57+
- Check for existing helpers in the `pyrefly_types` crate before manually creating or destructuring a `Type`
58+
59+
### Type Checker Concerns
60+
- Changes to type inference should consider edge cases
61+
- Modifications to error messages should be clear and actionable
62+
- Performance is critical for the language server
63+
64+
### Code Style
65+
- Keep It Simple Stupid (KISS) - minimize concept count
66+
- Don't Repeat Yourself (DRY) - but don't over-abstract
67+
- Comments should explain "why", not "what"
68+
- Minimize places where `Expr` nodes are passed around
69+
70+
## Output Format
71+
72+
Provide your review in the following structure:
73+
74+
### Summary
75+
A brief (2-3 sentence) overview of what this diff does and your overall assessment.
76+
77+
### Issues Found
78+
List any problems, organized by severity:
79+
- **Critical**: Must fix before landing (correctness, security)
80+
- **Major**: Should fix (performance, maintainability)
81+
- **Minor**: Nice to fix (style, documentation)
82+
83+
For each issue, include:
84+
- File and line reference
85+
- Description of the problem
86+
- Suggested fix (if applicable)
87+
88+
### Positive Observations
89+
Note any particularly well-done aspects of the code.
90+
91+
### Questions
92+
Any clarifying questions for the author.

.github/workflows/build_binaries.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ jobs:
6262
with:
6363
python-version: ${{ env.PYTHON_VERSION }}
6464
architecture: ${{ matrix.platform.arch }}
65+
- name: Set jemalloc page size for macOS ARM64
66+
if: ${{ matrix.platform.target == 'aarch64' }}
67+
run: echo "JEMALLOC_SYS_WITH_LG_PAGE=14" >> $GITHUB_ENV
6568
- name: Build wheels
6669
uses: PyO3/maturin-action@v1
6770
with:

.github/workflows/build_extension.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ jobs:
105105
uses: Swatinem/rust-cache@v2
106106
with:
107107
prefix-key: pyrefly-extension
108+
- name: set jemalloc page size for ARM64 Linux
109+
if: ${{ matrix.arch == 'arm64' && matrix.platform == 'linux' || matrix.arch == 'arm64' && matrix.platform == 'alpine' }}
110+
run: echo "JEMALLOC_SYS_WITH_LG_PAGE=16" >> ${{ matrix.github_env }}
111+
- name: set jemalloc page size for ARM64 macOS
112+
if: ${{ matrix.arch == 'arm64' && matrix.platform == 'darwin' }}
113+
run: echo "JEMALLOC_SYS_WITH_LG_PAGE=14" >> ${{ matrix.github_env }}
108114
- name: build pyrefly binary (cross-compile)
109115
if: ${{ matrix.rust_target != '' }}
110116
uses: houseabsolute/actions-rust-cross@v1

0 commit comments

Comments
 (0)