formatting tool complient with 42 school's norm
Project description
C formatter for 42 norminette
This is C language formatter that fits 42 norminette. I know you are already a good Human norm. It's just for convenience.
Vim
Checkout c_formatter_42.vim
VSCode
- Install clang-format.
- MacOS
$ brew install clang-format
Or you can install vscode extension Clang-Format
-
Copy
.clang-format
in your Workspace directory. -
VSCode Settings
- Set Default Formatter as clang-format.
- Turn off
Format On Paste
,Format On Save
. - Or You can just copy this in your
.vscode/settings.json
file.
"editor.defaultFormatter": "xaver.clang-format",
"editor.formatOnPaste": false,
"editor.formatOnSave": false,
(🚨 CAUTION
Check your clang-format version.
If version is lower than 10, SpaceBeforeSquareBrackets: false
and AllowShortBlocksOnASingleLine: Never
can't work well.
So you should comment them out!)
- Execute code formatting
- On Windows: Shift + Alt + F
- On Mac: Shift + Option + F
- On Linux: Ctrl + Shift + I
🚨Caution(VSCode)
It's not perfect. You should format these rules MANUALLY after auto-formatting.
global aligned
declarations aligned
declarations must be followed by one empty line
Empty line
int aaaa = 12;
float b = 23;
std::string ccc = 23;
Recommended to set in Workspace Preference
.
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
Hashes for c_formatter_42-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72effa21743339f2b33386e5c749fd2a61beafe924a393d6785c098607e44e93 |
|
MD5 | b2067b26343d3966fb7bd2c3b348aa1e |
|
BLAKE2b-256 | 726a32c7aa089119a3a89340f882aa80028e55b291944251d0ad63327b954914 |