Skip to main content

findent: powerful Fortran formatter

Project description

PyPI Latest Release PyPi release

findent: powerful Fortran formatter

What is it?

findent indents/beautifies/converts and can optionally generate the dependencies of Fortran sources.

Features

  • Supports Fortran-66 up to Fortran-2018
  • Converts from Fixed Form to Free Form and vice-versa
  • Honours cpp and coco preprocess statements
  • Honours OpenMP conditionals
  • Validated against all constructs in 'Modern Fortran explained, Incorporating Fortran 2018, Metcalf e.a.'
  • Supported platformrs: Unix and Windows
  • High speed: 50K - 100K lines per second
  • Provides wrapper wfindent (wfindent.bat on Windows) for batch file processing
  • vim, gedit, emacs: findent optionally emits configuration files for these editors to use findent as a plugin.
  • GUI frontent available in a separate package: jfindent

Examples

Format file in.f90 to out.f90

findent < in.f90 > out.f90

Format with 4-space indentation and convert Fixed Form in.f to Free Form out.f90

findent -i4 -Rr < in.f > out.f90

Format and refactor all files with .f extension in the current directory

wfindent -i4 -Rr *.f

Generating Fortran source dependencies for use in Makefile

findent will generate a dependency list for:

  • definitions and uses of modules and submodules
  • include, #include and ??include statements

In your Makefile add something similar to:

findent --makefdeps > makefdeps
chmod +x makefdeps

include deps
dep deps:
  ./makefdeps *.f90 > deps

The flag --makefdeps generates a script in the standard output. Depending on your usecase the script might not suffice and you will need to write your own version.

Editor incorporation

(G) VIM users

Installation instructions:

findent --vim_help

Documentation:

:help equalprg

:help indentexpr

GEDIT users

Installation instructions:

findent --gedit_help

EMACS users

Installation instructions:

findent --emacs_help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

findent-4.1.2.dev0-py2.py3-none-win_amd64.whl (4.1 MB view details)

Uploaded Python 2Python 3Windows x86-64

findent-4.1.2.dev0-py2.py3-none-manylinux1_x86_64.whl (2.2 MB view details)

Uploaded Python 2Python 3

findent-4.1.2.dev0-py2.py3-none-macosx_10_15_x86_64.whl (317.3 kB view details)

Uploaded Python 2Python 3macOS 10.15+ x86-64

File details

Details for the file findent-4.1.2.dev0-py2.py3-none-win_amd64.whl.

File metadata

  • Download URL: findent-4.1.2.dev0-py2.py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 2, Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for findent-4.1.2.dev0-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 c0a706fa9b4f7feb0d2c0c135a58d9454516cd4824f37158379cc5f27a42ff27
MD5 aee93c2e0bd904e2bc1208d054057e67
BLAKE2b-256 34a4bc1c3f125aa3cfe80ae59b3e1bb9fc2e93ab0759c3869f3b908dc0ced472

See more details on using hashes here.

File details

Details for the file findent-4.1.2.dev0-py2.py3-none-manylinux1_x86_64.whl.

File metadata

  • Download URL: findent-4.1.2.dev0-py2.py3-none-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for findent-4.1.2.dev0-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3e93a8700b2caafbc4f4a6f67a0f4f5cfeb76bb5ae63ec64623ade2b3b8543b1
MD5 b8cc0872e9eafb1db53acc78d679a6a3
BLAKE2b-256 9041904be6326d074d76d5dd4e9656b9c9fda1c47a8d26686eb7e288b7af9418

See more details on using hashes here.

File details

Details for the file findent-4.1.2.dev0-py2.py3-none-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: findent-4.1.2.dev0-py2.py3-none-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 317.3 kB
  • Tags: Python 2, Python 3, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for findent-4.1.2.dev0-py2.py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 28bf6ec18241d193551f700eda98f4f2555c276afd2a1415a6ebcdd8c2356e13
MD5 4e9113f509caa0c6980d047107b25b4a
BLAKE2b-256 b09ab3c198b2177338540ad3a2cd4ddc149f5cc33850e6e18165d233486d35ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page