Skip to content

Commit

Permalink
Added pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
platipodium committed Oct 16, 2024
1 parent 5407221 commit 376265b
Show file tree
Hide file tree
Showing 4 changed files with 274 additions and 6 deletions.
30 changes: 30 additions & 0 deletions .fprettify.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: 2024 Helmholtz-Zentrum hereon GmbH (Hereon)
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileContributor: Carsten Lemmen <[email protected]

enable-replacements=True
c-relations=True

# White space settings
indent=2
line-length=132
strict-indent=True
strip-comments=True
whitespace-relational=True
whitespace-logical=True
whitespace-plusminus=True
whitespace-multdiv=True
whitespace-comma=True
whitespace-intrinsics=True
whitespace-print=True
whitespace-type=False

# Control whitespace around '::' declarations
whitespace-decl=True
enable-decl=True

# Don't indent pre-processor statements
disable-fypp=True

case=[1,1,1,1]
exclude=[]
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: 2024 Helmholtz-Zentrum hereon GmbH (Hereon)
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileContributor: Carsten Lemmen <[email protected]
#
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: [pre-commit, pre-push]
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict

# - repo: https://github.com/pseewald/fprettify
# rev: v0.3.7
# hooks:
# - id: fprettify
# name: auto-formatter for modern fortran source code
# description: imposes strict whitespace formatting for modern (F90+) Fortran code
# entry: fprettify -c .fprettify.rc
# language: python
# files: \.[fF]\d*$
214 changes: 211 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum hereon GmbH (Hereon)
# SPDX-FileCopyrightText: 2022-2024 Helmholtz-Zentrum hereon GmbH (Hereon)
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileContributor: Carsten Lemmen <[email protected]

Expand All @@ -11,11 +11,13 @@ license = "CC0-1.0"
readme = "Readme.md"

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
fprettify = "^0.3.7"

[tool.poetry.dev-dependencies]
reuse = "^0.14.0"
pre-commit = "^4.0.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"

0 comments on commit 376265b

Please sign in to comment.