Skip to main content

EPITA C Coding Style Checker - validates C code against EPITA coding standards

Project description

EPITA C Coding Style Checker

A fast C linter for EPITA coding style rules. Uses tree-sitter for robust AST-based parsing.

Installation

pipx install epita-coding-style

Quick Start

epita-coding-style src/           # Check files/directories
epita-coding-style --list-rules   # List all rules with descriptions
epita-coding-style --show-config  # Show current configuration
epita-coding-style --help         # Full usage info

Configuration

Configuration is auto-detected from (in order):

  • .epita-style
  • .epita-style.toml
  • epita-style.toml
  • [tool.epita-coding-style] in pyproject.toml

Priority: CLI flags > config file > preset > defaults

Generate a Config File

epita-coding-style --show-config --no-color > .epita-style.toml

This outputs a complete, commented TOML config you can customize.

Presets

epita-coding-style --preset 42sh src/      # 40 lines, goto/cast allowed
epita-coding-style --preset noformat src/  # Same + skip clang-format

Example Config

# .epita-style.toml
max_lines = 40

[rules]
"keyword.goto" = false  # Allow goto
"cast" = false          # Allow casts

Or in pyproject.toml:

[tool.epita-coding-style]
max_lines = 40

[tool.epita-coding-style.rules]
"keyword.goto" = false

clang-format

The format rule uses clang-format to check code formatting. Requires clang-format to be installed.

The checker looks for .clang-format in the file's directory (walking up to root), or uses the bundled EPITA config.

To disable: set "format" = false in your config, or use --preset noformat.

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/KazeTachinuu/epita-coding-style
    rev: v2.3.0
    hooks:
      - id: epita-coding-style
        args: [--preset, 42sh]  # optional

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epita_coding_style-2.3.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epita_coding_style-2.3.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file epita_coding_style-2.3.0.tar.gz.

File metadata

  • Download URL: epita_coding_style-2.3.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for epita_coding_style-2.3.0.tar.gz
Algorithm Hash digest
SHA256 aa37cae0476f7e0e7c03b3a09e6833b8d774acf915e6af2950988de1a96779c9
MD5 cc1c4896d55646ff911f9e6f5b9f6ecf
BLAKE2b-256 b983de857cbbe249c7d335bdf9dd0c20a880a475d275b821d73042e52b07c821

See more details on using hashes here.

File details

Details for the file epita_coding_style-2.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for epita_coding_style-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43abaf9de404e95759f16d6e10caa9f2d0474fdd79fc06b8ab77e074b218e633
MD5 82fbd222f6dfc2a335d6894c3fdfd435
BLAKE2b-256 18872bc05e31bf5ee26b5714d8ecfab3d540c8eb386a9e2f7ed5db4491088761

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page