Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a826fcb
ci(loc-gate): fail when any .rs file exceeds 1000 LOC
zackees May 18, 2026
26f4be1
refactor(fbuild-packages): split disk_cache/index.rs into submodules …
zackees May 18, 2026
6f3f7c0
refactor(fbuild-config): split ini_parser.rs into submodules to satis…
zackees May 18, 2026
1c9e167
refactor(fbuild-deploy): split esp32.rs into submodules to satisfy LO…
zackees May 18, 2026
5c90d0e
refactor(fbuild-config): split board.rs into submodules to satisfy LO…
zackees May 18, 2026
0c1ffbd
refactor(fbuild-deploy): split esp32_native.rs into submodules to sat…
zackees May 18, 2026
5c313bb
refactor(fbuild-packages): split library/esp32_framework.rs into subm…
zackees May 18, 2026
236a759
refactor(fbuild-daemon): split handlers/operations.rs into submodules…
zackees May 18, 2026
f86817a
refactor(fbuild-python): split lib.rs into submodules to satisfy LOC …
zackees May 18, 2026
8d0b64c
refactor(fbuild-build): split compile_database.rs into submodules to …
zackees May 18, 2026
64dd868
refactor(fbuild-build): split pipeline.rs into submodules to satisfy …
zackees May 18, 2026
91f54e4
refactor(fbuild-build): split esp32/orchestrator.rs into submodules t…
zackees May 18, 2026
0cca5f3
refactor(fbuild-build): split stm32/orchestrator.rs into submodules t…
zackees May 18, 2026
f31619e
refactor(fbuild-cli): split mcp.rs into submodules to satisfy LOC gate
zackees May 18, 2026
0ac109e
refactor(fbuild-daemon): split handlers/emulator.rs into submodules t…
zackees May 18, 2026
af0f456
refactor(fbuild-cli): split main.rs into submodules to satisfy LOC gate
zackees May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/loc-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: LOC Gate

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
loc-gate:
name: Reject .rs files over 1000 LOC
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check .rs file line counts
shell: bash
run: |
set -euo pipefail
THRESHOLD=1000
violations=0
while IFS= read -r -d '' file; do
lines=$(wc -l < "$file")
if [ "$lines" -gt "$THRESHOLD" ]; then
echo "::error file=${file}::${file} has ${lines} LOC (limit: ${THRESHOLD})"
echo "FAIL ${lines} ${file}"
violations=$((violations + 1))
fi
done < <(find . -type f -name '*.rs' \
-not -path './target/*' \
-not -path './.git/*' \
-print0)
if [ "$violations" -gt 0 ]; then
echo ""
echo "Found ${violations} .rs file(s) over ${THRESHOLD} LOC."
echo "Split them into smaller modules before merging."
exit 1
fi
echo "All .rs files are within the ${THRESHOLD} LOC limit."
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
[![Build Native Binaries](https://github.com/fastled/fbuild/actions/workflows/build.yml/badge.svg)](https://github.com/fastled/fbuild/actions/workflows/build.yml)
[![Library Selection Acceptance (#205)](https://github.com/fastled/fbuild/actions/workflows/acceptance-205.yml/badge.svg)](https://github.com/fastled/fbuild/actions/workflows/acceptance-205.yml)
[![Library Selection Perf (#205)](https://github.com/fastled/fbuild/actions/workflows/bench-205.yml/badge.svg)](https://github.com/fastled/fbuild/actions/workflows/bench-205.yml)
[![LOC Gate](https://github.com/fastled/fbuild/actions/workflows/loc-gate.yml/badge.svg)](https://github.com/fastled/fbuild/actions/workflows/loc-gate.yml)

<details>
<summary><strong>Per-platform board build badges</strong> (click to expand)</summary>
Expand Down
Loading
Loading