Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{css,hcl,html,json,less,md,xml,xsl,yml,yaml}]
indent_size = 2

[{Makefile,makefile,GNUmakefile,Caddyfile}]
indent_style = tab
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @thermondo/platform
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
commit-message:
prefix: "chore"
schedule:
interval: "weekly"
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ "**" ]

permissions:
contents: read

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: install pre-commit
run: pipx install pre-commit

- name: lint
run: pre-commit run --all --show-diff-on-failure --color=always
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#hooks-available
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
26 changes: 26 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- id: check-terraform-lock
name: check-terraform-lock
description: make sure your terraform lock file contains provider hashes for both macOS and linux
entry: terraform providers lock -platform=darwin_arm64 -platform=darwin_amd64 -platform=linux_amd64
language: system
files: .terraform.lock.hcl
pass_filenames: false
- id: terraform-fmt
name: terraform-fmt
description: autoformat terraform source code
entry: bin/terraform-fmt.sh
language: script
types:
- terraform
- id: ruff-lint
name: ruff-lint
entry: ruff check . --fix --exit-non-zero-on-fix
language: system
types:
- python
- id: ruff-format
name: ruff-format
entry: ruff format .
language: system
types:
- python
18 changes: 18 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright 2025 Thermondo GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the “Software”), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
26 changes: 26 additions & 0 deletions bin/terraform-fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
#
# Remove excessive empty lines and run `terraform fmt` on files
#
# Example usage:
#
# ./terraform-fmt.sh foo.tf bar.tf
#

set -euo pipefail

init() {
if command -v gsed &>/dev/null; then
SED_CMD="gsed"
else
SED_CMD="sed"
fi
}

main() {
init
$SED_CMD -i '/^$/N;/^\n$/D' "$@"
terraform fmt "$@"
}

main "$@"