From 32e01e8d71e18e3798306b870d8674c8b02a30c0 Mon Sep 17 00:00:00 2001 From: HueByte Date: Thu, 19 Feb 2026 10:08:39 +0100 Subject: [PATCH] feat: Add .gitattributes to enforce LF line endings for shell scripts --- .gitattributes | 2 ++ scripts/lint-markdown.sh | 48 ++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4abd01e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Force LF line endings for shell scripts (required for Linux CI runners) +*.sh text eol=lf diff --git a/scripts/lint-markdown.sh b/scripts/lint-markdown.sh index f16d74d..3d6c1af 100644 --- a/scripts/lint-markdown.sh +++ b/scripts/lint-markdown.sh @@ -1,24 +1,24 @@ -#!/usr/bin/env bash -# -# Lint all Markdown files in the repository. -# Config, globs, and ignores are defined in .markdownlint-cli2.jsonc. -# -# Usage: -# ./scripts/lint-markdown.sh # check -# ./scripts/lint-markdown.sh --fix # auto-fix -# -set -euo pipefail - -REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" -cd "$REPO_ROOT" - -# Resolve markdownlint-cli2 binary -if command -v markdownlint-cli2 &>/dev/null; then - LINT_CMD="markdownlint-cli2" -else - LINT_CMD="npx --yes markdownlint-cli2" -fi - -echo "Linting Markdown files..." -$LINT_CMD "$@" -echo "Markdown lint passed." +#!/usr/bin/env bash +# +# Lint all Markdown files in the repository. +# Config, globs, and ignores are defined in .markdownlint-cli2.jsonc. +# +# Usage: +# ./scripts/lint-markdown.sh # check +# ./scripts/lint-markdown.sh --fix # auto-fix +# +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +cd "$REPO_ROOT" + +# Resolve markdownlint-cli2 binary +if command -v markdownlint-cli2 &>/dev/null; then + LINT_CMD="markdownlint-cli2" +else + LINT_CMD="npx --yes markdownlint-cli2" +fi + +echo "Linting Markdown files..." +$LINT_CMD "$@" +echo "Markdown lint passed."