Skip to main content

EPITA C/C++ Coding Style Checker - validates C and 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-3.0.0.tar.gz (31.3 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-3.0.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: epita_coding_style-3.0.0.tar.gz
  • Upload date:
  • Size: 31.3 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-3.0.0.tar.gz
Algorithm Hash digest
SHA256 025561b7af63bf8e31495b207a6bc957e48564b864c4490aab5e629bf99eb412
MD5 8e01b21b8d674997175118ade7a0bf16
BLAKE2b-256 95072815099585cd79e979bbf60b8502e6d1bf3801b6ffbf3468cbe5bce26598

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for epita_coding_style-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1120aaebe79e424643b8b48ecbc84c0be56be5addc26c7edad629df09b0566dc
MD5 f548036932e2d1649c7505e65b1c0974
BLAKE2b-256 7d496c7c394fc6fa8aed7676807a9af352d1adfefb5d9f4782b90c2c755896b3

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