Skip to content
프로젝트

소개

42 norminette용 C 언어 포매터

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+1
in 7 days
+2
in 15 days
+3
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

PyPI version


c_formatter_42

C language prettier that conforms to 42 norm v3. I know you are already a good human norm. It's just for convenience.

Installation

Requires Python3.8+ (3.9, 3.10, 3.11, 3.12)

With pipx (recommanded)

pipx run c-formatter-42

With pip

pip3 install c-formatter-42
pip3 install --user c-formatter-42  # If you don't have root privileges

If you're on Ubuntu 22.04 or newer (or any Debian-based system with PEP 668 enabled), you might see an error like:

error: externally-managed-environment

To fix this, add the --break-system-packages flag:

pip3 install --break-system-packages c-formatter-42

From source

git clone https://github.com/cacharle/c_formatter_42
cd c_formatter_42
pip3 install -e .

Usage

Command line

c_formatter_42 < file.c
python3 -m c_formatter_42 < file.c  # If you get 'command not found' with the previous one

c_formatter_42 --help
usage: c_formatter_42 [-h] [-c] [FILE [FILE ...]]

Format C source according to the norm

positional arguments:
  FILE           File to format inplace, if no file is provided read STDIN

optional arguments:
  -h, --help     show this help message and exit
  -c, --confirm  Ask confirmation before overwriting any file

Plugins / Extensions

Vim

Check out the c_formatter_42.vim plugin. This plugin automatically installs the c_formatter_42 package using pip.

Visual Studio Code

  1. Install c_formatter_42
  2. Install the keyhr.42-c-format extension
  3. Set keyhr.42-c-format as the default formatter for C files in .vscode/settings.json
{
  "[c]": {
    "editor.defaultFormatter": "keyhr.42-c-format"
  }
}

Contributing

Feel free to report issues or contribute. :)

Run the tests

pip3 install tox
tox
tox -e py311  # for a specific python version

Deploy a new version

pip3 install bumpversion
bumpversion [major|minor|patch]
git push
git push --tags

Go to: https://github.com/dawnbeen/c_formatter_42/tags and click on the tag you just created. Then click on Create release from tag, the pipeline will build and deploy that version for you.

관련 프로젝트 살펴보기

불러오는 중…