{"id":18847873,"url":"https://github.com/zmoon/findent-pre-commit","last_synced_at":"2025-07-27T10:34:04.152Z","repository":{"id":114822111,"uuid":"502120711","full_name":"zmoon/findent-pre-commit","owner":"zmoon","description":"Use findent as a pre-commit hook","archived":false,"fork":false,"pushed_at":"2025-06-18T20:51:08.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T21:37:27.580Z","etag":null,"topics":["fortran","pre-commit","pre-commit-hooks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmoon.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":"2022-06-10T17:04:52.000Z","updated_at":"2025-06-18T20:51:11.000Z","dependencies_parsed_at":"2023-09-25T01:44:32.161Z","dependency_job_id":"c311a7de-f75d-4076-a3ae-b223f706fc96","html_url":"https://github.com/zmoon/findent-pre-commit","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"65627b82c4103aa12dd0fb6b3267bfb1abd858c7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zmoon/findent-pre-commit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoon%2Ffindent-pre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoon%2Ffindent-pre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoon%2Ffindent-pre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoon%2Ffindent-pre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmoon","download_url":"https://codeload.github.com/zmoon/findent-pre-commit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoon%2Ffindent-pre-commit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267345341,"owners_count":24072504,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","pre-commit","pre-commit-hooks"],"created_at":"2024-11-08T03:09:57.103Z","updated_at":"2025-07-27T10:34:04.095Z","avatar_url":"https://github.com/zmoon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# findent-pre-commit\n\nUse [findent](https://www.ratrabbit.nl/ratrabbit/findent/)\nas a [pre-commit](https://pre-commit.com/) hook.\n\n\n## Requirements\n\n[pre-commit](https://pre-commit.com/#install), and:\n\n* The `wfindent-conda` and `findent-conda` hooks require `conda` available on `PATH`\n  (or `mamba`, with `PRE_COMMIT_USE_MAMBA=1`).\n* The `wfindent-system` hook requires `wfindent` available on `PATH`.\n* The `findent-system` hook requires `findent` available on `PATH`.\n\n\n## Usage\n\nAdd one of the hooks defined in [`.pre-commit-hooks.yaml`](./.pre-commit-hooks.yaml)\nto your `.pre-commit-config.yaml` file.\n\nFor example:\n```yaml\nrepos:\n  - repo: https://github.com/zmoon/findent-pre-commit\n    rev: main\n    hooks:\n      - id: wfindent-system\n```\n\nTo control which files get formatted, set\n```yaml\n        files: \u003cregex\u003e\n```\nto match them.\nThe current setting (`\\.[fF](90|95|03|08)$`) matches free-form sources files\n[according to GCC](https://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-and-GCC.html).\n\nTo pass args to `findent`, use, for example:\n```yaml\n        args: [--indent=4, -r0]\n```\n\n### Specify `findent` version\n\nThere are multiple ways to achieve this:\n\n* for `findent-system`, use the `--findent-version-pin` arg, which will check the version before running\n\n  ```yaml\n          args: [--findent-version-pin=4.3.3]\n  ```\n\n* for `findent-pypi`/`wfindent-pypi`, pin `findent` in `additional_dependencies`\n\n  ```yaml\n          additional_dependencies: [findent==4.3.1]\n  ```\n\n  - findent-pypi releases can be found [on GitHub](https://github.com/gnikit/findent-pypi/releases)\n  - releases since `4.2.6.post0` should work for Windows (in addition to Unix-like)\n\n* for `findent-conda`/`wfindent-conda`, pin `findent` in `additional_dependencies`\n\n  ```yaml\n          additional_dependencies: [findent==4.3.2]\n  ```\n\n  - available versions can be found [on conda-forge](https://anaconda.org/conda-forge/findent/files)\n\n* for `wfindent-system`, there is currently no way to ensure a certain `findent` version is being used\n\n## Wrapper\n\nTo install the Python wrapper `findent-wrapper` with [`pipx`](https://pypa.github.io/pipx/):\n\n```\npipx install https://github.com/zmoon/findent-pre-commit/archive/main.zip\n```\n\nNote that the `wfindent` tool distributed with findent and referenced above provides in-place editing\nusing shell scripting.\n`findent-wrapper` adds a `--diff` option (and maybe more options in the future...).\n\n\n## Another way\n\nAs an alternative to the `wfindent-system` hook defined in this repo, it is possible\nto use a [local hook](https://pre-commit.com/#repository-local-hooks) setup.\n\n```yaml\n# .pre-commit-config.yaml\n\n- repo: local\n  hooks:\n    - id: wfindent\n      name: Format Fortran code using findent\n      entry: wfindent\n      description: Uses system copy of wfindent available on PATH.\n      language: system\n      pass_filenames: true\n      files: \\.[fF](90|95|03|08)$\n      types: [text]\n      require_serial: true\n```\n\nNote that `findent` cannot be used in this way, since it only reads from STDIN.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmoon%2Ffindent-pre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmoon%2Ffindent-pre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmoon%2Ffindent-pre-commit/lists"}