Skip to content

Commit

Permalink
Add many nice tools
Browse files Browse the repository at this point in the history
  • Loading branch information
GereonV committed Nov 27, 2024
1 parent 0e9a6a3 commit 1fa89db
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 0 deletions.
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

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

[Makefile]
indent_style = tab

[*.{yml,yaml}]
indent_size = 2
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Global
on: [push]
jobs:
pre-commit:
runs-on: ubuntu:latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit 'manual' hooks
run: pre-commit run --color=always
--all-files
--hook-stage manual
--show-diff-on-failure
--verbose
15 changes: 15 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pre-commit:
image: python:latest
stage: test
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
cache:
key: pre-commit
paths: ["${PRE_COMMIT_HOME}"]
script:
- pip install pre-commit
- pre-commit run --color=always
--all-files
--hook-stage manual
--show-diff-on-failure
--verbose
15 changes: 15 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[general]
ignore=body-is-missing
verbosity=3

[title-max-length]
line-length=80

[title-min-length]
min-length=5

[body-max-line-length]
line-length=120

[body-min-length]
min-length=5
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
default_install_hook_types: [commit-msg, pre-commit, pre-merge-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=100]
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
args: [--fix=lf]
- id: pretty-format-json
args: [--autofix, --ident=4, --no-sort-keys]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.0.3
hooks:
- id: editorconfig-checker
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
- id: gitlint-ci
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
16 changes: 16 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends: default
rules:
document-end:
present: false
document-start:
present: false
indentation:
spaces: 2
indent-sequences: false
key-duplicates: {}
line-length:
max: 80
level: warning
quoted-strings:
required: only-when-needed
trailing-spaces: {}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Project templates

[![Python](https://github.com/GereonV/templates/actions/workflows/python.yml/badge.svg)](https://github.com/GereonV/templates/tree/python)
[![GitLab CI](https://gitlab.com/gereon36/templates/badges/python/pipeline.svg)](https://gitlab.com/gereon36/templates/-/tree/python)\
[![C++](https://github.com/GereonV/templates/actions/workflows/cpp.yml/badge.svg)](https://github.com/GereonV/templates/tree/cpp)
Expand Down

0 comments on commit 1fa89db

Please sign in to comment.