EPITA C Coding Style Checker
A Python script to check C code against EPITA coding style rules.
Usage
# Check current directory (recursive)
./check.py
# Check specific files or directories
./check.py src/
./check.py main.c utils.h
# Options
./check.py --help
./check.py --max-lines 30 # Custom max function lines
./check.py --no-color # Disable colored output
./check.py -q # Quiet mode (summary only)
Rules Checked
fun.length- Max 40 lines per function bodyfun.arg.count- Max 4 arguments per functionfun.proto.void- Empty params should usevoiddecl.single- One declaration per linedecl.vla- No variable-length arraysfile.trailing- No trailing whitespacefile.dos- No CRLF line endingsfile.terminate- File must end with newlinefile.spurious- No blank lines at start/endlines.empty- No consecutive empty linescpp.guard- Header files need include guardscpp.mark- Preprocessor#on first columncpp.if-#endifneeds commentcpp.digraphs- No digraphs/trigraphsstat.asm- No asm declarationsctrl.empty- Empty loops should usecontinue
Development
# Setup
uv sync --dev
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=check