{ "info": { "author": "Patrick Seewald", "author_email": "patrick.seewald@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Quality Assurance" ], "description": "# fprettify\n\n[![Build Status](https://travis-ci.com/pseewald/fprettify.svg?branch=master)](https://travis-ci.com/pseewald/fprettify) [![Coverage Status](https://coveralls.io/repos/github/pseewald/fprettify/badge.svg?branch=master)](https://coveralls.io/github/pseewald/fprettify?branch=master) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0) [![PyPI version](https://badge.fury.io/py/fprettify.svg)](https://badge.fury.io/py/fprettify)\n\nfprettify is an auto-formatter for modern Fortran code that imposes strict whitespace formatting, written in Python.\n\n\n## Features\n\n* Auto-indentation.\n* Line continuations are aligned with the previous opening delimiter `(`, `[` or `(/` or with an assignment operator `=` or `=>`. If none of the above is present, a default hanging indent is applied.\n* Consistent amount of whitespace around operators and delimiters.\n* Removal of extraneous whitespace and consecutive blank lines.\n* Tested for editor integration.\n* By default, fprettify causes whitespace changes only and thus preserves revision history.\n* fprettify can handle cpp and [fypp](https://github.com/aradi/fypp) preprocessor directives.\n\n\n## Limitations\n\n* Works only for modern Fortran (Fortran 90 upwards).\n* Feature missing? Please create an issue.\n\n\n## Requirements\n\n* Python 2.7 or Python 3.x\n* [ConfigArgParse](https://pypi.org/project/ConfigArgParse): optional, enables use of config file\n\n\n## Examples\n\nCompare `examples/*before.f90` (original Fortran files) with `examples/*after.f90` (reformatted Fortran files) to see what fprettify does. A quick demonstration:\n\n``` Fortran\nprogram demo\ninteger :: endif,if,elseif\ninteger,DIMENSION(2) :: function\nendif=3;if=2\nif(endif==2)then\nendif=5\nelseif=if+4*(endif+&\n2**10)\nelseif(endif==3)then\nfunction(if)=endif/elseif\nprint*,endif\nendif\nend program\n```\n\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9 `fprettify` \u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\u21e9\n``` Fortran\nprogram demo\n integer :: endif, if, elseif\n integer, DIMENSION(2) :: function\n endif = 3; if = 2\n if (endif == 2) then\n endif = 5\n elseif = if + 4*(endif + &\n 2**10)\n elseif (endif == 3) then\n function(if) = endif/elseif\n print *, endif\n endif\nend program\n```\n\n\n## Installation\n\nThe latest release can be installed using pip:\n```\npip install --upgrade fprettify\n```\n\nInstallation from source requires Python Setuptools:\n```\n./setup.py install\n```\n\nFor local installation, use `--user` option.\n\n\n## Command line tool\n\nAutoformat file1, file2, ... inplace by\n```\nfprettify file1, file2, ...\n```\nThe default indent is 3. If you prefer something else, use `--indent n` argument.\n\nIn order to apply fprettify recursively to an entire Fortran project instead of a single file, use the `-r` option.\n\nFor more options, read\n```\nfprettify -h\n```\n\n\n## Editor integration\n\nFor editor integration, use\n```\nfprettify --silent\n```\nFor instance, with Vim, use fprettify with `gq` by putting the following commands in your `.vimrc`:\n```vim\nautocmd Filetype fortran setlocal formatprg=fprettify\\ --silent\n```\n\n\n## Deactivation and manual formatting (experimental feature)\n\nfprettify can be deactivated for selected lines: a single line followed by an inline comment starting with `!&` is not auto-formatted and consecutive lines that are enclosed between two comment lines `!&<` and `!&>` are not auto-formatted. This is useful for cases where manual alignment is preferred over auto-formatting. Furthermore, deactivation is necessary when non-standard Fortran syntax (such as advanced usage of preprocessor directives) prevents proper formatting. As an example, consider the following snippet of fprettify formatted code:\n```fortran\nA = [-1, 10, 0, &\n 0, 1000, 0, &\n 0, -1, 1]\n```\nIn order to manually align the columns, fprettify needs to be deactivated by\n```fortran\nA = [-1, 10, 0, & !&\n 0, 1000, 0, & !&\n 0, -1, 1] !&\n```\nor, equivalently by\n```fortran\n!&<\nA = [-1, 10, 0, &\n 0, 1000, 0, &\n 0, -1, 1]\n!&>\n```\n\n\n## Contributing / Testing\n\nThe testing mechanism allows you to easily test fprettify with any Fortran project of your choice. Simply clone or copy your entire project into `fortran_tests/before` and run `python setup.py test`. The directory `fortran_tests/after` contains the test output (reformatted Fortran files). If testing fails, please submit an issue!\n\n\n[![Code Climate](https://codeclimate.com/github/pseewald/fprettify/badges/gpa.svg)](https://codeclimate.com/github/pseewald/fprettify)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/pseewald/fprettify/archive/v0.3.4.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pseewald/fprettify", "keywords": "fortran format formatting auto-formatter indent", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "fprettify", "package_url": "https://pypi.org/project/fprettify/", "platform": "", "project_url": "https://pypi.org/project/fprettify/", "project_urls": { "Download": "https://github.com/pseewald/fprettify/archive/v0.3.4.tar.gz", "Homepage": "https://github.com/pseewald/fprettify" }, "release_url": "https://pypi.org/project/fprettify/0.3.4/", "requires_dist": [ "configargparse" ], "requires_python": "", "summary": "auto-formatter for modern fortran source code", "version": "0.3.4" }, "last_serial": 5357485, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "17a43c8043006dcd86147cc24a86d5b2", "sha256": "64bc0db4d92d4133a42e85e80ea36daa1c4494758b2496521257707a99fdd399" }, "downloads": -1, "filename": "fprettify-0.1-py2.7.egg", "has_sig": false, "md5_digest": "17a43c8043006dcd86147cc24a86d5b2", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 30685, "upload_time": "2017-01-02T00:56:18", "url": "https://files.pythonhosted.org/packages/e5/ec/c6044e4988518d1e39ba502d18b421930af7756be5932b022a551cca2112/fprettify-0.1-py2.7.egg" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "7c42fda2e0c35bf489595a98c6d61656", "sha256": "0968a2ac9715637ee92bd57b9e6e304afbb4ddecbed59a26fc167378c2b66f17" }, "downloads": -1, "filename": "fprettify-0.3-py2.7.egg", "has_sig": false, "md5_digest": "7c42fda2e0c35bf489595a98c6d61656", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 33625, "upload_time": "2017-01-02T00:56:20", "url": "https://files.pythonhosted.org/packages/38/ce/1f6463ac0af707c82c2c6da4effb8f80f12383a0f72a3853599a7f6c0769/fprettify-0.3-py2.7.egg" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "31b0be042777ca411da00a1a738a0ef4", "sha256": "438010a346c1dacad89ffac34ca8e0bb6c57ec07f8a7e8c01afc0f2f28843b2e" }, "downloads": -1, "filename": "fprettify-0.3.1-py2.7.egg", "has_sig": false, "md5_digest": "31b0be042777ca411da00a1a738a0ef4", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 34959, "upload_time": "2017-01-02T00:56:21", "url": "https://files.pythonhosted.org/packages/bb/51/3d334880c2bcc2ec25a1da72358360c9c9a86d5827a2690574a680271247/fprettify-0.3.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "e90a1808f10cca9d1624bd9824a6150c", "sha256": "bdf565056aa35d134126c78a7af6ebbea7aa0658ab3b8ca623e5278537296f85" }, "downloads": -1, "filename": "fprettify-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e90a1808f10cca9d1624bd9824a6150c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 19225, "upload_time": "2017-01-02T00:56:17", "url": "https://files.pythonhosted.org/packages/3f/80/b61dc3491cc79bfdd8d98dce38193840d1f3067a7f8cb1c2c4959595b18c/fprettify-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "707cded1394acdff3d14b29b1f610fb3", "sha256": "8a6452fad3ee4520cefe936cfadb762fe9e53aabead7896889eac4fedf173cc3" }, "downloads": -1, "filename": "fprettify-0.3.1.tar.gz", "has_sig": false, "md5_digest": "707cded1394acdff3d14b29b1f610fb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15183, "upload_time": "2017-01-02T00:56:23", "url": "https://files.pythonhosted.org/packages/08/9f/ac5475e675ae8f15327f7b3edf435bf3d3a216b971f8347895fb961e36df/fprettify-0.3.1.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "9ca6c223ec7e3d006a80bbfff44ff590", "sha256": "729f075e7dfa1a6c84aaa3d33d23647e82de400bac3e68c642e8b116a37fd0bf" }, "downloads": -1, "filename": "fprettify-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9ca6c223ec7e3d006a80bbfff44ff590", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20058, "upload_time": "2018-09-04T15:26:47", "url": "https://files.pythonhosted.org/packages/11/11/5f2003d9bf2e0bb875b5b08300e165993ee3f1fb5c431be8c03f720cb6d3/fprettify-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "942e192e667bd56be485afe9c487bbcd", "sha256": "0b68d8e85ddb49be8e1580f6de4ada4dc65b71e11fea611eecd77f3154868154" }, "downloads": -1, "filename": "fprettify-0.3.3.tar.gz", "has_sig": false, "md5_digest": "942e192e667bd56be485afe9c487bbcd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19609, "upload_time": "2018-09-04T15:26:49", "url": "https://files.pythonhosted.org/packages/30/b6/730b808098b66cfdd7363add63eb824a04a0ac511fe4892e2af55560ae4c/fprettify-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "903ffbe323e77882cb6a2a2391a6bd1b", "sha256": "32a29d00cf79239a913011e739749d3b59b4d80abbedb8b40c77032d6da76c63" }, "downloads": -1, "filename": "fprettify-0.3.4-py3-none-any.whl", "has_sig": false, "md5_digest": "903ffbe323e77882cb6a2a2391a6bd1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22254, "upload_time": "2019-06-04T13:38:43", "url": "https://files.pythonhosted.org/packages/43/a2/235925914971897806aaa86c1b78f59b400865934de628404a7589ba9f04/fprettify-0.3.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5dfc52c6415589da5f482d1b48d9ccc2", "sha256": "a5a8741f9e732ced9f5a326a880f4005501a732578322bba1a541db64e165533" }, "downloads": -1, "filename": "fprettify-0.3.4.tar.gz", "has_sig": false, "md5_digest": "5dfc52c6415589da5f482d1b48d9ccc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21050, "upload_time": "2019-06-04T13:38:45", "url": "https://files.pythonhosted.org/packages/f3/2d/0441a4220acb4657ae9f23d1964eebf27bd2bf7a64b873e2e18bf2a73e7c/fprettify-0.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "903ffbe323e77882cb6a2a2391a6bd1b", "sha256": "32a29d00cf79239a913011e739749d3b59b4d80abbedb8b40c77032d6da76c63" }, "downloads": -1, "filename": "fprettify-0.3.4-py3-none-any.whl", "has_sig": false, "md5_digest": "903ffbe323e77882cb6a2a2391a6bd1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22254, "upload_time": "2019-06-04T13:38:43", "url": "https://files.pythonhosted.org/packages/43/a2/235925914971897806aaa86c1b78f59b400865934de628404a7589ba9f04/fprettify-0.3.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5dfc52c6415589da5f482d1b48d9ccc2", "sha256": "a5a8741f9e732ced9f5a326a880f4005501a732578322bba1a541db64e165533" }, "downloads": -1, "filename": "fprettify-0.3.4.tar.gz", "has_sig": false, "md5_digest": "5dfc52c6415589da5f482d1b48d9ccc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21050, "upload_time": "2019-06-04T13:38:45", "url": "https://files.pythonhosted.org/packages/f3/2d/0441a4220acb4657ae9f23d1964eebf27bd2bf7a64b873e2e18bf2a73e7c/fprettify-0.3.4.tar.gz" } ] }