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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ jobs:
node-version: 22.x
cache: npm

- name: Check for CRLF line endings
run: |
if git grep -Il $'\r'; then
echo "::error::CRLF line endings detected. Configure your editor to use LF line endings (this repo has an .editorconfig file that most editors respect automatically)."
exit 1
fi
- run: |
FILES=$(
find src/content \
Expand Down
32 changes: 32 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
# Convert CRLF to LF in all staged files before committing.
# This guards against AI tooling and Windows environments introducing CRLF.

STAGED=$(git diff --cached --name-only)

if [ -z "$STAGED" ]; then
exit 0
fi

FIXED=0

while IFS= read -r file; do
# Skip files that no longer exist on disk (e.g. deleted files)
if [ ! -f "$file" ]; then
continue
fi

# Check for carriage returns
if grep -qU $'\r' "$file"; then
# perl -pi works cross-platform (macOS BSD and Linux GNU)
perl -pi -e 's/\r\n/\n/g; s/\r/\n/g' "$file"
FIXED=1
fi
done << EOF
$STAGED
EOF

if [ "$FIXED" = "1" ]; then
echo "pre-commit: CRLF line endings converted to LF in staged files."
git add --update
fi
17 changes: 17 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"ai-setup:import-from-opencode": "npx rulesync import --targets opencode --features rules,commands,subagents",
"ai-setup:claudecode": "npm run ai-setup:import-from-opencode && npx rulesync generate --targets claudecode --features rules,commands,subagents",
"ai-setup:cursor": "npm run ai-setup:import-from-opencode && npx rulesync generate --targets cursor --features commands,subagents",
"ai-setup:copilot": "npm run ai-setup:import-from-opencode && npx rulesync generate --targets copilot --features commands,subagents"
"ai-setup:copilot": "npm run ai-setup:import-from-opencode && npx rulesync generate --targets copilot --features commands,subagents",
"prepare": "husky"
},
"devDependencies": {
"@actions/core": "1.11.1",
Expand Down Expand Up @@ -86,6 +87,7 @@
"hast-util-select": "6.0.4",
"hastscript": "9.0.1",
"he": "1.2.0",
"husky": "9.1.7",
"jsonc-parser": "3.3.1",
"ldrs": "1.1.7",
"lz-string": "1.5.0",
Expand Down
Loading