Commit d3b24d4
Sync GitHub linting with Meta's internal pyfmt configuration (#154)
Summary:
This change synchronizes the GitHub Actions linting workflow with Meta's internal pyfmt configuration to ensure consistent code formatting between internal and external development environments.
Previously, the GitHub workflow used `black` directly for formatting checks, which caused discrepancies with Meta's internal linting that uses `ruff-api` (via ufmt). This led to situations where code would pass Meta's `pyfmt` checks but fail GitHub CI, or vice versa.
This diff adds:
1. **Configuration files** matching Meta's internal setup:
- `.flake8` - Flake8 configuration with Black-compatible ignore rules
- `pyproject.toml` - ufmt configuration using ruff-api formatter and usort
- `requirements-fmt.txt` - Pinned versions from Meta's internal tools/lint/pyfmt/reqs/requirements-fmt.txt
- `.pre-commit-config.yaml` - Pre-commit hooks for ufmt and flake8
2. **GitHub workflow updates**:
- Replaced `black --check .` with `ufmt check .`
- Added all required dependencies (black==24.4.2, ruff-api==0.1.0, ufmt==2.8.0, usort==1.0.8.post1)
- Fixed flake8 invocation to use explicit path
3. **Documentation updates**:
- Updated CONTRIBUTING.md with comprehensive linting and formatting instructions
- Documented the new workflow for contributors
- Explained configuration files and their purposes
The versions are pinned to exactly match Meta's internal setup, ensuring 100% consistency between environments.
Pull Request resolved: #154
Reviewed By: atavory
Differential Revision: D87183125
Pulled By: talgalili
fbshipit-source-id: 1445a9af1f093cb9d103d914c5eedb65fce569a81 parent 09a30b9 commit d3b24d4
File tree
6 files changed
+91
-5
lines changed- .github/workflows
6 files changed
+91
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
37 | 68 | | |
38 | 69 | | |
39 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments