42 C-Format is a VScode formatting provider extension for c_formatter_42, which is a c-language formatter that conforms to Norm v3 in 42 schools.
Provide document formatting using c_formatter_42.
- Installing
c_formatter_42is required.
$ pip3 install c_formatter_42
$ pip3 install --user c_formatter_42 // if you don't have privilege
- Then enable formatting with 42 C-Format, adding configuration as below.
{
"[c]": {
"editor.defaultFormatter": "keyhr.42-c-format"
},
}You can customize the formatter execution by configuring the following settings:
- Type:
string - Default:
"c_formatter_42" - Description: The executable name or full path to the formatter.
- Type:
arrayof strings - Default:
[] - Description: Command-line arguments to pass to the formatter.
No configuration needed if c_formatter_42 is installed as a command (e.g., via pipx):
$ pipx install c_formatter_42If you installed with pip and want to run as a Python module:
{
"42-c-format.executable": "python3",
"42-c-format.args": ["-m", "c_formatter_42"]
}On Windows, use "python" instead of "python3":
{
"42-c-format.executable": "python",
"42-c-format.args": ["-m", "c_formatter_42"]
}Specify a full path to the formatter executable:
{
"42-c-format.executable": "/usr/local/bin/c_formatter_42"
}c_formatter_42(GitHub Repository)
Issues and pull requests are welcomed.
Breaking Change: The default execution method has changed from python3 -m c_formatter_42 to c_formatter_42 command.
- Added configurable formatter executable path via
42-c-format.executablesetting - Added configurable command-line arguments via
42-c-format.argssetting - If you prefer to run as a Python module, please configure the settings as described in the Configuration section
- Improved error handling and timeout management
Added windows support.
Improved output when catching an error.
Added an instruction for installing c_formatter_42.
Fixed the usage instruction.
Initial release.
