<p align="center">
<a style="text-decoration:none" href="https://badge.fury.io/py/c-formatter-42"><img src="https://badge.fury.io/py/c-formatter-42.svg" alt="PyPI version" height="20"></a>
<a style="text-decoration:none" href="https://github.com/dawnbeen/c_formatter_42/actions"><img src="https://github.com/cacharle/c_formatter_42/actions/workflows/python-package.yml/badge.svg" height="20"></a>
<a style="text-decoration:none" href="https://github.com/dawnbeen/c_formatter_42/actions"><img src="https://github.com/cacharle/c_formatter_42/actions/workflows/python-publish.yml/badge.svg" height="20"></a>
<a style="text-decoration:none" href="https://pypi.org/project/c-formatter-42/"><img src="https://img.shields.io/pypi/pyversions/c-formatter-42" height="20"></a>
</p>
<br />
<p align="center">
<img width="65%" align="center" src="./img/final_back.png">
</p>
# 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.8+ (3.9, 3.10, 3.11)
### From PyPI
```console
$ pip3 install c-formatter-42
$ pip3 install --user c-formatter-42 # If you don't have root privileges
```
### From source
```console
$ git clone https://github.com/cacharle/c_formatter_42
$ cd c_formatter_42
$ pip3 install -e .
```
## Usage
### Command line
```console
$ 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`](https://github.com/cacharle/c_formatter_42.vim) plugin. This plugin automatically installs the `c_formatter_42` package using pip.
### Visual Studio Code
1. Install `c_formatter_42`
1. Install the [`keyhr.42-c-format`](https://marketplace.visualstudio.com/items?itemName=keyhr.42-c-format) extension
1. Set `keyhr.42-c-format` as the default formatter for C files in `.vscode/settings.json`
```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 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/dawnbeen/c_formatter_42",
"name": "c-formatter-42",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/b8/29/8cb9e92e65e462e5344cfde7607e1576839b3978235ba47d63276c9b1332/c_formatter_42-0.2.7.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a style=\"text-decoration:none\" href=\"https://badge.fury.io/py/c-formatter-42\"><img src=\"https://badge.fury.io/py/c-formatter-42.svg\" alt=\"PyPI version\" height=\"20\"></a>\n <a style=\"text-decoration:none\" href=\"https://github.com/dawnbeen/c_formatter_42/actions\"><img src=\"https://github.com/cacharle/c_formatter_42/actions/workflows/python-package.yml/badge.svg\" height=\"20\"></a>\n <a style=\"text-decoration:none\" href=\"https://github.com/dawnbeen/c_formatter_42/actions\"><img src=\"https://github.com/cacharle/c_formatter_42/actions/workflows/python-publish.yml/badge.svg\" height=\"20\"></a>\n <a style=\"text-decoration:none\" href=\"https://pypi.org/project/c-formatter-42/\"><img src=\"https://img.shields.io/pypi/pyversions/c-formatter-42\" height=\"20\"></a>\n</p>\n\n<br />\n\n<p align=\"center\">\n <img width=\"65%\" align=\"center\" src=\"./img/final_back.png\">\n</p>\n\n# c_formatter_42\n\nC language prettier that conforms to 42 norm v3.\nI know you are already a good human norm.\nIt's just for convenience.\n\n## Installation\n\nRequires Python3.8+ (3.9, 3.10, 3.11)\n\n### From PyPI\n\n```console\n$ pip3 install c-formatter-42\n$ pip3 install --user c-formatter-42 # If you don't have root privileges\n```\n\n### From source\n\n```console\n$ git clone https://github.com/cacharle/c_formatter_42\n$ cd c_formatter_42\n$ pip3 install -e .\n```\n\n## Usage\n\n### Command line\n\n```console\n$ c_formatter_42 < file.c\n$ python3 -m c_formatter_42 < file.c # If you get 'command not found' with the previous one\n\n$ c_formatter_42 --help\nusage: c_formatter_42 [-h] [-c] [FILE [FILE ...]]\n\nFormat C source according to the norm\n\npositional arguments:\n FILE File to format inplace, if no file is provided read STDIN\n\noptional arguments:\n -h, --help show this help message and exit\n -c, --confirm Ask confirmation before overwriting any file\n```\n\n## Plugins / Extensions\n\n### Vim\n\nCheck out the [`c_formatter_42.vim`](https://github.com/cacharle/c_formatter_42.vim) plugin. This plugin automatically installs the `c_formatter_42` package using pip.\n\n### Visual Studio Code\n\n1. Install `c_formatter_42`\n1. Install the [`keyhr.42-c-format`](https://marketplace.visualstudio.com/items?itemName=keyhr.42-c-format) extension\n1. Set `keyhr.42-c-format` as the default formatter for C files in `.vscode/settings.json`\n\n```json\n{\n \"[c]\": {\n \"editor.defaultFormatter\": \"keyhr.42-c-format\"\n }\n}\n```\n\n## Contributing\n\nFeel free to report issues or contribute. :)\n\n### Run the tests\n\n```\n$ pip3 install tox\n$ tox\n$ tox -e py311 # for a specific python version\n```\n\n### Deploy a new version\n\n```\n$ pip3 install bumpversion\n$ bumpversion [major|minor|patch]\n$ git push\n$ git push --tags\n```\n\nGo to: <https://github.com/dawnbeen/c_formatter_42/tags> and click on the tag you just created.\nThen click on `Create release from tag`, the pipeline will build and deploy that version for you.\n",
"bugtrack_url": null,
"license": "",
"summary": "formatting tool complient with 42 school's norm",
"version": "0.2.7",
"project_urls": {
"Homepage": "https://github.com/dawnbeen/c_formatter_42",
"Tracker": "https://github.com/dawnbeen/c_formatter_42/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "18b577d974319d29604d144beb34d9c38361af618adc0e1ae3a9bb4945aeacd5",
"md5": "b3488d62e1ac37b23e7d6dc98245632f",
"sha256": "2a108b48f22f17516bb90562c733761997fe8ef1ac8163318e16740b096426b9"
},
"downloads": -1,
"filename": "c_formatter_42-0.2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b3488d62e1ac37b23e7d6dc98245632f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 2711704,
"upload_time": "2023-10-05T11:45:28",
"upload_time_iso_8601": "2023-10-05T11:45:28.312741Z",
"url": "https://files.pythonhosted.org/packages/18/b5/77d974319d29604d144beb34d9c38361af618adc0e1ae3a9bb4945aeacd5/c_formatter_42-0.2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b8298cb9e92e65e462e5344cfde7607e1576839b3978235ba47d63276c9b1332",
"md5": "557e328e6645db9b94cb1160c0dcd901",
"sha256": "89e3edb7761f7461af03852e4f0ff3a00ffaec6fd83786810e1fae149bce20f2"
},
"downloads": -1,
"filename": "c_formatter_42-0.2.7.tar.gz",
"has_sig": false,
"md5_digest": "557e328e6645db9b94cb1160c0dcd901",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 2704720,
"upload_time": "2023-10-05T11:45:30",
"upload_time_iso_8601": "2023-10-05T11:45:30.214336Z",
"url": "https://files.pythonhosted.org/packages/b8/29/8cb9e92e65e462e5344cfde7607e1576839b3978235ba47d63276c9b1332/c_formatter_42-0.2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-05 11:45:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dawnbeen",
"github_project": "c_formatter_42",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "c-formatter-42"
}