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.1.tar.gz (17.8 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.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: epita_coding_style-2.3.1.tar.gz
  • Upload date:
  • Size: 17.8 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.1.tar.gz
Algorithm Hash digest
SHA256 e50f5cbdf6d1805cb544a9119c9422187bfe9e011dd881f18bb5d48b0b3bbc3b
MD5 4e3cc2018b738be9792144296c91ffc6
BLAKE2b-256 6280e1f4a92f64885a026a65a81111e0ac2b11f848100b10c0bdc2198314a423

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for epita_coding_style-2.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 334de19139176d80915d800e09e842a978b0216f511205b4a265596b8f3a1fd4
MD5 3711e792905914e8a9709f7effb56486
BLAKE2b-256 f2ae2fa4285885c0cf5bcccc64fd95c2a2f793dcd17d726f7df335078507339c

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