Skip to content

Commit 028c621

Browse files
committed
prep for v0.3.1 and for submitting to PyPI
1 parent 814a3ac commit 028c621

File tree

2 files changed

+114
-3
lines changed

2 files changed

+114
-3
lines changed

README.rst

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
fprettify
2+
=========
3+
4+
|License: GPL v3|
5+
6+
fprettify is an auto-formatter for modern Fortran code that imposes
7+
strict whitespace formatting.
8+
9+
Features
10+
--------
11+
12+
- Auto-indentation.
13+
- Line continuations are aligned with the previous opening delimiter
14+
``(``, ``[`` or ``(/`` or with an assignment operator ``=`` or
15+
``=>``. If none of the above is present, a default hanging indent is
16+
applied.
17+
- Consistent amount of whitespace around operators and delimiters.
18+
- Removal of extraneous whitespace and consecutive blank lines.
19+
- Works only for modern Fortran (Fortran 90 upwards).
20+
- Tested for editor integration.
21+
- By default, fprettify causes changes in the amount of whitespace only
22+
and thus preserves revision history.
23+
24+
Example
25+
--------
26+
27+
.. code:: fortran
28+
29+
program demo
30+
integer :: endif,if,else
31+
endif=3; if=2
32+
if(endif==2)then
33+
endif=5
34+
else=if+4*(endif+&
35+
2**10)
36+
else if(endif==3)then
37+
print*,endif
38+
endif
39+
end program
40+
41+
⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩ ``fprettify`` ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
42+
43+
.. code:: fortran
44+
45+
program demo
46+
integer :: endif, if, else
47+
endif = 3; if = 2
48+
if (endif == 2) then
49+
endif = 5
50+
else = if + 4*(endif + &
51+
2**10)
52+
else if (endif == 3) then
53+
print *, endif
54+
endif
55+
end program
56+
57+
Usage
58+
-----
59+
60+
Autoformat file1, file2, ... inplace by
61+
62+
::
63+
64+
fprettify file1, file2, ...
65+
66+
The default indent is 3. If you prefer something else, use
67+
``--indent n`` argument. For more options, read
68+
69+
::
70+
71+
fprettify -h
72+
73+
For editor integration, use
74+
75+
::
76+
77+
fprettify --silent
78+
79+
For instance, with Vim, use fprettify with ``gq`` by putting the
80+
following commands in your ``.vimrc``:
81+
82+
.. code:: vim
83+
84+
autocmd Filetype fortran setlocal formatprg=fprettify\ --silent
85+
86+
.. |License: GPL v3| image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
87+
:target: http://www.gnu.org/licenses/gpl-3.0

setup.py

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
11
#!/usr/bin/env python
2-
32
from setuptools import setup
3+
from codecs import open
4+
from os import path
5+
6+
here = path.abspath(path.dirname(__file__))
7+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
8+
long_description = f.read()
49

510
setup(name='fprettify',
6-
version='0.3',
11+
version='0.3.1',
712
description='auto-formatter for modern fortran source code',
8-
author='Patrick Seewald, Ole Schuett, Tiziano Mueller, Mohamed Fawzi',
13+
long_description=long_description,
14+
author='Patrick Seewald',
15+
author_email='[email protected]',
916
license='GPLv3',
1017
entry_points={'console_scripts': ['fprettify = fprettify:run']},
1118
packages=['fprettify'],
1219
test_suite='fprettify.tests',
20+
install_requires=['future'],
21+
keywords='fortran format formatting auto-formatter indent',
22+
url='https://github.com/pseewald/fprettify',
23+
download_url= 'https://github.com/pseewald/fprettify/archive/v0.3.1.tar.gz',
24+
classifiers=[
25+
'Development Status :: 5 - Production/Stable',
26+
'Intended Audience :: Developers',
27+
'Topic :: Software Development :: Quality Assurance',
28+
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
29+
'Programming Language :: Python :: 2',
30+
'Programming Language :: Python :: 2.7',
31+
'Programming Language :: Python :: 3',
32+
'Programming Language :: Python :: 3.4',
33+
'Programming Language :: Python :: 3.5',
34+
'Environment :: Console',
35+
'Operating System :: OS Independent',
36+
]
1337
)

0 commit comments

Comments
 (0)