Skip to main content

42 ".c" Code Formatter

This tool automatically formats your C code to comply with the 42 norm.

Installation

To install the package, you can use either of the following methods:

With pip:

pip install 42formatter
pipx install 42formatter

Why pipx?

pipx is recommended if you want to install the tool in an isolated environment, avoiding conflicts with other Python packages.

How to Use

Run the following command to format your C file(s):

x42format <input_file(s)>

Features

  • Skip 42 header or Alert you if it's missing/invalid
  • Replace " " (4 spaces) by " " TAB
  • Fix variable declaration format
  • Put space after flow control keywork -> "while(" becomes "while (" | "break;" becomes "break ;"
  • Fix missing ";" at end of lines that needs one
  • Fix strange spaces before and after pointer -> "type * var" -> "type\t*var"
  • Fix merged spaces and tabs -> " \t " -> "\t"
  • Fix spaces around operators -> "1+1" -> "1 + 1"
  • Remove useless empty lines
  • Fix function declaration format
  • Fix newline after closing brace : "}"
  • Fix strange spaces around type casting

License

This project is under a Proprietary License.
All rights are reserved. The project remains the property of Antoine Josse.
Any modifications or contributions to the project require prior permission from the author (contact at ajosse@student.42.fr).
Redistribution under a different name is not allowed.
The project must always be attributed to the original author.

Contributing

If you have any suggestions for improvements, feel free to contact me at ajosse@student.42.fr.


This tool is here to save you time while battling with Norminette.

Antoine :)


Metadata

Release files for 42formatter 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for 42formatter 0.1.2
File Size Uploaded Provenance
42formatter-0.1.2.tar.gz 6.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for 42formatter 0.1.2
File Interpreter ABI Platform
42formatter-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / 42formatter-0.1.2.tar.gz

Download URL 42formatter-0.1.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
10fd8d3e7a6b32d94b716864ae82f1307e4b3144fb00818a86c4483238e94dfa
BLAKE2b-256 checksum
How to use checksums
c4e1d891918abe0f714764e4a3399b52b6da225690c6cc8d06dbd5a43588e0e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / 42formatter-0.1.2-py3-none-any.whl

Download URL 42formatter-0.1.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5243a240936d792c80dd6fe3b703f782f75f7b2ee64edb37c98815f9f4672000
BLAKE2b-256 checksum
How to use checksums
06de27f4b3c63f42403efed13d82fe44d1a4b1e5d399733de523e8edf016275f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for 42formatter 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page