[codex] Improve code quality across clients #488
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: File Length Check | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| permissions: | |
| contents: read | |
| jobs: | |
| file-length: | |
| name: Check files under 500 lines | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check max 500 lines | |
| shell: bash | |
| run: | | |
| MAX_LINES=500 | |
| FOUND_TOO_LONG=0 | |
| while IFS= read -r file; do | |
| lines=$(wc -l < "$file") | |
| if [ "$lines" -gt "$MAX_LINES" ]; then | |
| echo "Error: $file has $lines lines (max $MAX_LINES allowed)" | |
| FOUND_TOO_LONG=1 | |
| fi | |
| done < <(find . -type f \( \ | |
| -name "*.rs" -o \ | |
| -name "*.kt" -o \ | |
| -name "*.py" -o \ | |
| -name "*.ts" -o \ | |
| -name "*.tsx" -o \ | |
| -name "*.js" \ | |
| \) \ | |
| -not -path "*/target/*" \ | |
| -not -path "*/node_modules/*" \ | |
| -not -path "*/android/app/build/*" \ | |
| -not -path "*/.git/*") | |
| if [ "$FOUND_TOO_LONG" -eq 1 ]; then | |
| echo "Please split the above files into smaller modules." | |
| exit 1 | |
| fi |