Metadata-Version: 2.4
Name: epita-coding-style
Version: 2.0.0
Summary: EPITA C Coding Style Checker - validates C code against EPITA coding standards
Project-URL: Homepage, https://github.com/KazeTachinuu/coding-style
Project-URL: Repository, https://github.com/KazeTachinuu/coding-style
Project-URL: Issues, https://github.com/KazeTachinuu/coding-style/issues
Author: Hugo
License-Expression: MIT
Keywords: c,checker,coding-style,epita,linter
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.10
Requires-Dist: tree-sitter-c>=0.23.0
Requires-Dist: tree-sitter>=0.23.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# EPITA C Coding Style Checker

A fast C code linter that validates against EPITA coding style rules. Uses [tree-sitter](https://tree-sitter.github.io/) for robust parsing.

## Installation

```bash
pipx install epita-coding-style
```

Or with pip:
```bash
pip install epita-coding-style
```

## Usage

```bash
# Check current directory
coding-style-check

# Check specific files or directories
coding-style-check src/
coding-style-check main.c utils.h

# Options
coding-style-check --help
coding-style-check --max-lines 30    # Custom max function lines
coding-style-check --max-args 5      # Custom max function args
coding-style-check --no-color        # Disable colored output
coding-style-check -q                # Quiet mode (summary only)
```

## Rules Checked

| Rule | Description |
|------|-------------|
| `fun.length` | Max 40 lines per function body |
| `fun.arg.count` | Max 4 arguments per function |
| `fun.proto.void` | Empty params should use `void` |
| `export.fun` | Max 10 exported functions per file |
| `export.other` | Max 1 exported global variable |
| `braces` | Allman brace style (braces on own line) |
| `decl.single` | One declaration per line |
| `decl.vla` | No variable-length arrays |
| `file.trailing` | No trailing whitespace |
| `file.dos` | No CRLF line endings |
| `file.terminate` | File must end with newline |
| `file.spurious` | No blank lines at start/end |
| `lines.empty` | No consecutive empty lines |
| `cpp.guard` | Header files need include guards |
| `cpp.mark` | Preprocessor `#` on first column |
| `cpp.if` | `#endif` needs comment |
| `cpp.digraphs` | No digraphs/trigraphs |
| `stat.asm` | No asm declarations |
| `ctrl.empty` | Empty loops should use `continue` |

## Example Output

```
src/parser.c
  42: [MAJOR] fun.arg.count: 'parse_node' has 5 args (max 4)
  156: [MAJOR] fun.length: Function has 45 lines (max 40)

src/utils.c
  12: [MINOR] file.trailing: Trailing whitespace

Files: 2  Major: 2  Minor: 1
```

## Development

```bash
# Clone and setup
git clone https://github.com/KazeTachinuu/coding-style
cd coding-style
uv sync --dev

# Run tests
uv run pytest

# Build
python -m build
```

## License

MIT
