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.4.2.tar.gz (18.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.4.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: epita_coding_style-2.4.2.tar.gz
  • Upload date:
  • Size: 18.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.4.2.tar.gz
Algorithm Hash digest
SHA256 b4ad9c1aedc0f0bc59722e181c4a6ad6201b1e0c46e07a5af384ffbbdee650d2
MD5 f6868adc061bd55bd75b5fc824a71846
BLAKE2b-256 6eca3e9f58960343ac459f24d060d0670fcb7403e2cbd086a197f1330452026c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for epita_coding_style-2.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f8128d3917e3d7dbd58117e6f0a345e2c5ab078cb76d97a5ca5c90cf62deea1
MD5 192d91e7636a4d0deacc16e3284304f3
BLAKE2b-256 0014f287cdb0db8d6d93aa3404e991c087b045c8b6dc4877d220fe7af828b966

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