From 476cf6c48dac0f9f0a3efca68419494abaf00493 Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:55:07 +0100 Subject: [PATCH] chore: store text files with LF line endings Refs #203 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .devcontainer/devcontainer.json | 38 +++++++-------- .gitattributes | 85 ++++++++++++++++++++++++++++++++ .gitignore | 24 ++++----- .lefthook.toml | 78 +++++++++++++++--------------- .vscode/extensions.json | 12 ++--- .vscode/settings.json | 60 +++++++++++------------ LICENSE | 40 +++++++-------- cliff.toml | 86 ++++++++++++++++----------------- cog.toml | 34 ++++++------- renovate.json5 | 32 ++++++------ 10 files changed, 287 insertions(+), 202 deletions(-) create mode 100644 .gitattributes diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1676dad..79b2a01 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,19 +1,19 @@ -{ - "name": "blog", - "image": "mcr.microsoft.com/devcontainers/base:debian-12@sha256:23fa69fed758b7927c60061317d73baf7d66b9fca5c344e80bce3a940b229af0", - "postCreateCommand": "bash .devcontainer/post-create.sh", - "customizations": { - "vscode": { - "extensions": [ - "blueglassblock.better-json5", - "dprint.dprint", - "foxundermoon.shell-format", - "redhat.vscode-yaml", - "timonwong.shellcheck" - ], - "settings": { - "git.postCommitCommand": "none" - } - } - } -} +{ + "name": "blog", + "image": "mcr.microsoft.com/devcontainers/base:debian-12@sha256:23fa69fed758b7927c60061317d73baf7d66b9fca5c344e80bce3a940b229af0", + "postCreateCommand": "bash .devcontainer/post-create.sh", + "customizations": { + "vscode": { + "extensions": [ + "blueglassblock.better-json5", + "dprint.dprint", + "foxundermoon.shell-format", + "redhat.vscode-yaml", + "timonwong.shellcheck" + ], + "settings": { + "git.postCommitCommand": "none" + } + } + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f38dfaa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,85 @@ +# Line endings for this repository, bootstrapped by DevSecNinja/.github +# config-sync (config-sync/templates/.gitattributes). Config-sync adds it only +# when the repository has no .gitattributes and never overwrites it: the +# repository owns this file. Add repository-specific rules at the end; later +# lines win. Based on the shared ~/.gitattributes in DevSecNinja/dotfiles +# (home/dot_gitattributes). + +# LF in the repository and in every checkout, on every OS. A path that needs +# CRLF gets its own rule below, for example: +# *.ps1 text eol=crlf CRLF in the checkout, LF in the repository +# *.ics -text stored byte for byte (RFC 5545 calendars need CRLF) +# The shared Lint workflow (lint-line-endings) fails on text files committed +# with CRLF, except -text paths. +* text=auto eol=lf + +# Scripts stay LF even when a repository changes the default above. +*.bash text eol=lf +*.fish text eol=lf +*.ksh text eol=lf +*.sh text eol=lf +*.zsh text eol=lf + +# cmd.exe misreads labels and GOTO in batch files with LF line endings. +*.bat text eol=crlf +*.cmd text eol=crlf + +# A patch keeps the line endings of the files it changes. +*.patch -text + +# SVG is XML: text, not binary. +*.svg text + +# Binary files: no line-ending conversion and no text diff. +# Images +*.avif binary +*.eps binary +*.gif binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary +*.tif binary +*.tiff binary +*.webp binary +# Documents +*.docx binary +*.pdf binary +*.pptx binary +*.xlsx binary +# Fonts +*.eot binary +*.otf binary +*.ttf binary +*.woff binary +*.woff2 binary +# Audio and video +*.mp3 binary +*.mp4 binary +*.wav binary +*.webm binary +# Archives +*.7z binary +*.bz binary +*.bz2 binary +*.bzip2 binary +*.gz binary +*.lz binary +*.lzma binary +*.rar binary +*.tar binary +*.taz binary +*.tbz binary +*.tbz2 binary +*.tgz binary +*.tlz binary +*.txz binary +*.xz binary +*.Z binary +*.zip binary +*.zst binary +# Executables and libraries +*.dll binary +*.dylib binary +*.exe binary +*.so binary diff --git a/.gitignore b/.gitignore index b6031f7..e0438cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,13 @@ -# Hugo build output -public/ -resources/ - -# Hugo lock file -.hugo_build.lock - -# OS files -.DS_Store -Thumbs.db - -# Other app files +# Hugo build output +public/ +resources/ + +# Hugo lock file +.hugo_build.lock + +# OS files +.DS_Store +Thumbs.db + +# Other app files bin/ \ No newline at end of file diff --git a/.lefthook.toml b/.lefthook.toml index 5e8eee7..fbe7fab 100644 --- a/.lefthook.toml +++ b/.lefthook.toml @@ -1,39 +1,39 @@ -[pre-commit] -parallel = true - -[pre-commit.commands.actionlint] -run = "mise exec -- actionlint {staged_files}" -glob = [".github/workflows/*.yml", ".github/workflows/*.yaml"] - -[pre-commit.commands.format-yaml] -run = "mise exec -- yamlfmt {staged_files}" -glob = ["**/*.yaml", "**/*.yml"] -stage_fixed = true - -[pre-commit.commands.gitleaks] -run = "mise exec -- gitleaks protect --staged --redact" - -[pre-commit.commands.shellcheck] -run = "mise exec -- shellcheck {staged_files}" -glob = ["**/*.sh"] - -[pre-commit.commands.shfmt] -run = "mise exec -- shfmt --write {staged_files}" -glob = ["**/*.sh"] -stage_fixed = true - -[pre-commit.commands.yamllint] -run = "mise exec -- yamllint {staged_files}" -glob = ["**/*.yaml", "**/*.yml"] - -[pre-commit.commands.zizmor] -run = "mise exec -- zizmor {staged_files}" -glob = [".github/workflows/*.yml", ".github/workflows/*.yaml"] - -[pre-commit.commands.dprint] -run = "mise exec -- dprint fmt {staged_files}" -glob = ["**/*.md"] -stage_fixed = true - -[commit-msg.commands.cocogitto] -run = "mise exec -- cog verify \"$(cat {1})\"" +[pre-commit] +parallel = true + +[pre-commit.commands.actionlint] +run = "mise exec -- actionlint {staged_files}" +glob = [".github/workflows/*.yml", ".github/workflows/*.yaml"] + +[pre-commit.commands.format-yaml] +run = "mise exec -- yamlfmt {staged_files}" +glob = ["**/*.yaml", "**/*.yml"] +stage_fixed = true + +[pre-commit.commands.gitleaks] +run = "mise exec -- gitleaks protect --staged --redact" + +[pre-commit.commands.shellcheck] +run = "mise exec -- shellcheck {staged_files}" +glob = ["**/*.sh"] + +[pre-commit.commands.shfmt] +run = "mise exec -- shfmt --write {staged_files}" +glob = ["**/*.sh"] +stage_fixed = true + +[pre-commit.commands.yamllint] +run = "mise exec -- yamllint {staged_files}" +glob = ["**/*.yaml", "**/*.yml"] + +[pre-commit.commands.zizmor] +run = "mise exec -- zizmor {staged_files}" +glob = [".github/workflows/*.yml", ".github/workflows/*.yaml"] + +[pre-commit.commands.dprint] +run = "mise exec -- dprint fmt {staged_files}" +glob = ["**/*.md"] +stage_fixed = true + +[commit-msg.commands.cocogitto] +run = "mise exec -- cog verify \"$(cat {1})\"" diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d5235ed..e44be72 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ -{ - "recommendations": [ - "editorconfig.editorconfig", - "dprint.dprint" - ] -} +{ + "recommendations": [ + "editorconfig.editorconfig", + "dprint.dprint" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index b410c3c..bbda916 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,30 +1,30 @@ -{ - "editor.defaultFormatter": "dprint.dprint", - "editor.formatOnSave": true, - "files.autoSave": "onWindowChange", - "files.watcherExclude": { - "**/.git/objects/**": true, - "**/.git/subtree-cache/**": true, - "**/node_modules/*/**": true, - "**/.hugo_build.lock": true - }, - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true, - "**/Thumbs.db": true - }, - "search.exclude": { - "**/.git": true, - "**/node_modules": true, - "**/public": true, - "**/resources": true - }, - "[markdown]": { - "editor.defaultFormatter": "dprint.dprint" - }, - "[shellscript]": { - "editor.defaultFormatter": "foxundermoon.shell-format", - "editor.formatOnSave": true - }, - "git.postCommitCommand": "sync" -} +{ + "editor.defaultFormatter": "dprint.dprint", + "editor.formatOnSave": true, + "files.autoSave": "onWindowChange", + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/node_modules/*/**": true, + "**/.hugo_build.lock": true + }, + "files.exclude": { + "**/.git": true, + "**/.DS_Store": true, + "**/Thumbs.db": true + }, + "search.exclude": { + "**/.git": true, + "**/node_modules": true, + "**/public": true, + "**/resources": true + }, + "[markdown]": { + "editor.defaultFormatter": "dprint.dprint" + }, + "[shellscript]": { + "editor.defaultFormatter": "foxundermoon.shell-format", + "editor.formatOnSave": true + }, + "git.postCommitCommand": "sync" +} diff --git a/LICENSE b/LICENSE index 3e46c27..2076724 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2026 Jean-Paul van Ravensberg - -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 +MIT License + +Copyright (c) 2026 Jean-Paul van Ravensberg + +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. \ No newline at end of file diff --git a/cliff.toml b/cliff.toml index e715b0a..e79b0c4 100644 --- a/cliff.toml +++ b/cliff.toml @@ -1,43 +1,43 @@ -# see https://git-cliff.org/docs/configuration - -[changelog] -header = """ -# Changelog - -All notable changes to this project will be documented in this file. -""" -body = """ -{%- if version %} -## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} - -{%- endif %} -{%- for group, commits in commits | group_by(attribute="group") %} -### {{ group | upper_first }} -{% for commit in commits -%} -- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.message | upper_first }} ([`{{ commit.id | truncate(length=7, end="") }}`](https://github.com/DevSecNinja/blog/commit/{{ commit.id }})) -{% endfor %} -{%- endfor %}""" -footer = "" -trim = true - -[git] -conventional_commits = true -filter_unconventional = true -split_commits = false -commit_preprocessors = [ - { pattern = '\n.*', replace = "" }, -] -commit_parsers = [ - { message = "^feat", group = "Features" }, - { message = "^fix", group = "Bug Fixes" }, - { message = "^perf", group = "Performance" }, - { message = "^refactor", group = "Refactoring" }, - { message = "^docs", group = "Documentation" }, - { message = "^ci", group = "CI/CD" }, - { message = "^chore\\(release\\)", skip = true }, - { message = "^chore", group = "Miscellaneous" }, - { message = ".*", group = "Other" }, -] -filter_commits = false -tag_pattern = "v[0-9].*" -sort_commits = "newest" +# see https://git-cliff.org/docs/configuration + +[changelog] +header = """ +# Changelog + +All notable changes to this project will be documented in this file. +""" +body = """ +{%- if version %} +## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} + +{%- endif %} +{%- for group, commits in commits | group_by(attribute="group") %} +### {{ group | upper_first }} +{% for commit in commits -%} +- {% if commit.scope %}**{{ commit.scope }}**: {% endif %}{{ commit.message | upper_first }} ([`{{ commit.id | truncate(length=7, end="") }}`](https://github.com/DevSecNinja/blog/commit/{{ commit.id }})) +{% endfor %} +{%- endfor %}""" +footer = "" +trim = true + +[git] +conventional_commits = true +filter_unconventional = true +split_commits = false +commit_preprocessors = [ + { pattern = '\n.*', replace = "" }, +] +commit_parsers = [ + { message = "^feat", group = "Features" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^perf", group = "Performance" }, + { message = "^refactor", group = "Refactoring" }, + { message = "^docs", group = "Documentation" }, + { message = "^ci", group = "CI/CD" }, + { message = "^chore\\(release\\)", skip = true }, + { message = "^chore", group = "Miscellaneous" }, + { message = ".*", group = "Other" }, +] +filter_commits = false +tag_pattern = "v[0-9].*" +sort_commits = "newest" diff --git a/cog.toml b/cog.toml index aba90ea..a0e0fb1 100644 --- a/cog.toml +++ b/cog.toml @@ -1,17 +1,17 @@ -# see https://docs.cocogitto.io/ -tag_prefix = "v" -from_latest_tag = true -ignore_merge_commits = true -# Changelog is generated by git-cliff in pre_bump_hooks; disable cog's built-in output -disable_changelog = true - -pre_bump_hooks = [ - "mise exec -- git-cliff --tag {{version_tag}} --output CHANGELOG.md", - "mise exec -- dprint fmt CHANGELOG.md", - "git add CHANGELOG.md", -] - -post_bump_hooks = [ - "git push", - "git push origin {{version_tag}}", -] +# see https://docs.cocogitto.io/ +tag_prefix = "v" +from_latest_tag = true +ignore_merge_commits = true +# Changelog is generated by git-cliff in pre_bump_hooks; disable cog's built-in output +disable_changelog = true + +pre_bump_hooks = [ + "mise exec -- git-cliff --tag {{version_tag}} --output CHANGELOG.md", + "mise exec -- dprint fmt CHANGELOG.md", + "git add CHANGELOG.md", +] + +post_bump_hooks = [ + "git push", + "git push origin {{version_tag}}", +] diff --git a/renovate.json5 b/renovate.json5 index cda584c..3359a7b 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,16 +1,16 @@ -{ - $schema: "https://docs.renovatebot.com/renovate-schema.json", - extends: [ - "config:recommended", - "helpers:pinGitHubActionDigests", - ":dependencyDashboard", - ":semanticCommits", - "github>DevSecNinja/.github//.renovate/autoMerge.json5", - "github>DevSecNinja/.github//.renovate/base.json5", - "github>DevSecNinja/.github//.renovate/customManagers.json5", - "github>DevSecNinja/.github//.renovate/groups.json5", - "github>DevSecNinja/.github//.renovate/labels.json5", - "github>DevSecNinja/.github//.renovate/packageRules.json5", - "github>DevSecNinja/.github//.renovate/semanticCommits.json5", - ], -} +{ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: [ + "config:recommended", + "helpers:pinGitHubActionDigests", + ":dependencyDashboard", + ":semanticCommits", + "github>DevSecNinja/.github//.renovate/autoMerge.json5", + "github>DevSecNinja/.github//.renovate/base.json5", + "github>DevSecNinja/.github//.renovate/customManagers.json5", + "github>DevSecNinja/.github//.renovate/groups.json5", + "github>DevSecNinja/.github//.renovate/labels.json5", + "github>DevSecNinja/.github//.renovate/packageRules.json5", + "github>DevSecNinja/.github//.renovate/semanticCommits.json5", + ], +}