formatting tool complient with 42 school's norm
Project description
c_formatter_42
C language prettier that conforms to 42 norm. I know you are already a good Human norm. It's just for convenience.
Installation
Requires Python3.6+ (3.7, 3.8, 3.9, 3.10)
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
Vim
Checkout c_formatter_42.vim plugin. This plugin automatically installs the c_formatter_42 package using pip.
VSCode
- Install emeraldwalk.runonsave extension.
- Add Configuration to format with c_formatter_42 on save to vscode. (We recommend you to put it in
Workspace Preference
)
"emeraldwalk.runonsave": {
"commands": [{
"match": ".[ch]",
"cmd": "python3 -m c_formatter_42 < ${file} | tee _cfdump && cat _cfdump | tee ${file} && rm -f _cfdump"
}]
}
You can copy above and paste it in the .vscode/setting.json
.
Atom
Not supported yet, see related issue.
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 overwritting any file
Feel free to report issues or contribute. :)
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
Built Distribution
Close
Hashes for c_formatter_42-0.1.3.2.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bbcdc6b6bfe0523f85ef4ff8ba3c0b4391ec376521b9d7e6dfa1f14b0a92ed3 |
|
MD5 | 279cc80c7ae772cef91ed2bf30801199 |
|
BLAKE2b-256 | b0751c9ad19232d3537956407d7a7e87a374764cae8ac23d0e905f617920b49b |
Close
Hashes for c_formatter_42-0.1.3.2.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96201241498ddd5667dc3253693dfea66954fd0ec24a76bca53b89fa33fde6fa |
|
MD5 | 94abf8f5e524a1e88701c77ff4e1490e |
|
BLAKE2b-256 | e2ed0415dcb6651c30e5acd2da202d7332215acfa039ec356034e8f3cc446e60 |