formatting tool complient with 42 school's norm
Project description
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.7+ (3.8, 3.9, 3.10, 3.11)
From PyPI
$ pip3 install c-formatter-42
$ pip3 install --user c-formatter-42 # If you don't have root privileges
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
- Install
c_formatter_42
- Install the
keyhr.42-c-format
extension - 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 commit -m "Bumpversion a.b.c -> x.y.z
$ git tag vx.y.z
$ 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
c_formatter_42-0.2.4.tar.gz
(2.7 MB
view hashes)
Built Distribution
Close
Hashes for c_formatter_42-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f11d18bc7b079ef5165359730be31e38d8a10c6c38b08f10be31a0931bd99c5e |
|
MD5 | c6df209c3b98079f4b70a7215408b0b7 |
|
BLAKE2b-256 | 8900a0f62a0e861052b0ae1c3181f19d3d3718f319e0606946b0b9f59e45a07b |