{"id":19264159,"url":"https://github.com/cphyc/fortran-linter","last_synced_at":"2025-04-07T11:04:05.765Z","repository":{"id":24406668,"uuid":"110450996","full_name":"cphyc/fortran-linter","owner":"cphyc","description":"A simple fortran syntax checker, including automatic fixing of the code.","archived":false,"fork":false,"pushed_at":"2025-03-24T19:00:16.000Z","size":271,"stargazers_count":33,"open_issues_count":6,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T10:01:42.130Z","etag":null,"topics":["fortran","linter","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cphyc.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-12T16:56:22.000Z","updated_at":"2025-03-17T14:40:05.000Z","dependencies_parsed_at":"2023-09-24T12:52:41.741Z","dependency_job_id":"b8bc7dd1-c396-4ef9-9a33-592c7d401497","html_url":"https://github.com/cphyc/fortran-linter","commit_stats":{"total_commits":185,"total_committers":8,"mean_commits":23.125,"dds":0.6108108108108108,"last_synced_commit":"5bb95416e995cf8615ca00c856876d87ecf34ed8"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cphyc%2Ffortran-linter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cphyc%2Ffortran-linter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cphyc%2Ffortran-linter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cphyc%2Ffortran-linter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cphyc","download_url":"https://codeload.github.com/cphyc/fortran-linter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640461,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","linter","python3"],"created_at":"2024-11-09T19:40:03.449Z","updated_at":"2025-04-07T11:04:05.745Z","avatar_url":"https://github.com/cphyc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fortran linter\n\nThis linter works on a line-by-line basis to enforce some rules regarding the format of Fortran files.\n\nThe linter does not ship with any grammar and is solely based on regular expressions. This allows\nto easily add new rules, but this implies some limitations.\n\n## Installation\n\nThere are 2 ways of installing the linter. The recommended one is through pip\n\n\tpip install fortran-linter\n\nAlternatively, you can install it using `pipx`:\n\n\tpipx install fortran-linter\n\nor run it directly from the command line interface\n\n\tpipx run fortran-linter\n\nThe other way is to clone this repository and install it from the local copy:\n\n\tgit clone https://github.com/cphyc/fortran-syntax.git\n\tcd fortran-syntax\n\tpip install .\n\nPlease note that depending on your installation, you may have to add `sudo` to the `pip install` line. This is due to the fact that the package is shipped with a script `fortran-linter`. For some installation, the creation of this file may require root access.\n\n## Usage\n\nThis tool checks for fortran syntax against a few rules. To print a list of all the warnings for a file, run:\n\n    fortran-linter myfile.f90 --syntax-only\n\nTo autofix (most) warnings in place, do:\n\n    fortran-linter myfile.f90 -i\n\nThe original file will be backup'ed into `myfile.f90.orig`. All the safe fixes will be done and stored in the file `myfile.f90`.\n\nFor more help, you can type\n\n\tfortran-linter -h\n\n## Rules\n\nHere is a non-comprehensive set of rules that are enforced:\n  * Punctuation should be followed by a space, this includes `,`, `;` and `)`.\n  * Binary operators (`==`, `+`, ...) should be surrounded by spaces\n  * The following special characters are surrounded by at least one space: `::`, `=`.\n  * A line should not exceed 120 characters (this is somehow already extreme). The maximum line length can be controlled from the CLI.\n  * One should use `use mpi` instead of `include \"mpif.h\"`. Note that this is not fixed by default as it may break codes where `include \"mpif.h\"` follows and `implicit none` statement.\n  * Spaces are preferred over tabs, trailing whitespaces are cleaned.\n  * Warnings are raised if you use `real(8) :: foo`. One should rather use `integer, parameter :: dp = selected_real_kind(15); real(dp) :: foo` or `use iso_fortran_env; real(real64) :: foo`\n  * `print` statements should look like `print *, \"something\"`\n  * `write` statements should look like `write(*, *) \"something\"`\n  * Lines should be indented consistently (by default, using an indentation of 4 spaces)\n  * [FORD](https://forddocs.readthedocs.io/en/latest/) Compatibility: `!!` and `!\u003e` are preserved and treated as comments like `!` with one space after and at least one space before.\n\n# TODO list\n\n * [x] ship on pip\n * [ ] add more rules (this one will never end)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcphyc%2Ffortran-linter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcphyc%2Ffortran-linter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcphyc%2Ffortran-linter/lists"}