From 01666497cca149bff8cc60df00a89d306f71aacf Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Thu, 3 Jul 2025 12:04:21 +1000 Subject: [PATCH] Enforcing that the line endings should be LF --- .editorconfig | 34 +++++++++++++++++++++++ .gitattributes | 28 +++++++++++++++++++ .github/workflows/check-line-endings.yml | 26 ++++++++++++++++++ .gitignore | 1 + .vscode/extensions.json | 6 ++++ .vscode/settings.json | 35 +++++++++++++++++------- README.md | 13 ++++++++- SUPPORT.md | 30 ++++++++++---------- scripts/fix-line-endings.sh | 9 ++++++ 9 files changed, 156 insertions(+), 26 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/check-line-endings.yml create mode 100644 .vscode/extensions.json create mode 100755 scripts/fix-line-endings.sh diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..25ca37f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,34 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# All files +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +# Markdown files +[*.md] +trim_trailing_whitespace = false +max_line_length = off + +# JSON files +[*.json] +indent_size = 2 + +# JavaScript files +[*.js] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf + +# Windows scripts +[*.{cmd,bat}] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d85c21c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,28 @@ +# Set default behavior to automatically normalize line endings. +* text=auto eol=lf + +# Explicitly declare text files to be normalized and converted to native line endings on checkout. +*.md text eol=lf +*.txt text eol=lf +*.js text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.html text eol=lf +*.css text eol=lf +*.scss text eol=lf +*.ts text eol=lf +*.sh text eol=lf + +# Windows-specific files that should retain CRLF line endings +*.bat text eol=crlf +*.cmd text eol=crlf + +# Binary files that should not be modified +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.zip binary +*.pdf binary diff --git a/.github/workflows/check-line-endings.yml b/.github/workflows/check-line-endings.yml new file mode 100644 index 0000000..15a433c --- /dev/null +++ b/.github/workflows/check-line-endings.yml @@ -0,0 +1,26 @@ +name: Check Line Endings + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + check-line-endings: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Check for CRLF line endings in markdown files + run: | + ! grep -l $'\r' $(find . -name "*.md") + if [ $? -eq 0 ]; then + echo "✅ No CRLF line endings found in markdown files" + exit 0 + else + echo "❌ CRLF line endings found in markdown files" + echo "Files with CRLF line endings:" + grep -l $'\r' $(find . -name "*.md") + exit 1 + fi diff --git a/.gitignore b/.gitignore index f0c2429..4047669 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules *.orig +[Cc]opilot-[Pp]rocessing.md diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..d2b41d4 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "editorconfig.editorconfig", + "davidanson.vscode-markdownlint" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 32465d8..bf65aac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,26 @@ { - "chat.modeFilesLocations": { - "chatmodes": true - }, - "chat.promptFilesLocations": { - "prompts": true - }, - "chat.instructionsFilesLocations": { - "instructions": true - } -} \ No newline at end of file + "chat.modeFilesLocations": { + "chatmodes": true + }, + "chat.promptFilesLocations": { + "prompts": true + }, + "chat.instructionsFilesLocations": { + "instructions": true + }, + "files.eol": "\n", + "files.insertFinalNewline": true, + "files.trimTrailingWhitespace": true, + "[markdown]": { + "files.trimTrailingWhitespace": false, + "editor.formatOnSave": true + }, + "editor.rulers": [ + 100 + ], + "files.associations": { + "*.chatmode.md": "markdown", + "*.instructions.md": "markdown", + "*.prompt.md": "markdown" + } +} diff --git a/README.md b/README.md index 4a7c65f..15c5ca8 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,17 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e - [Custom Chat Modes](https://code.visualstudio.com/docs/copilot/chat/chat-modes) - Advanced chat configuration - [VS Code Settings](https://code.visualstudio.com/docs/getstarted/settings) - General VS Code configuration guide +## 🛠️ Development Configuration + +This repository uses various configuration files to ensure consistent code style and avoid issues with line endings: + +- [`.editorconfig`](.editorconfig) - Defines coding styles across different editors and IDEs +- [`.gitattributes`](.gitattributes) - Ensures consistent line endings in text files +- [`.vscode/settings.json`](.vscode/settings.json) - VS Code-specific settings for this repository +- [`.vscode/extensions.json`](.vscode/extensions.json) - Recommended VS Code extensions + +> 💡 **Note**: All markdown files in this repository use LF line endings (Unix-style) to avoid mixed line endings issues. The repository is configured to automatically handle line endings conversion. + ## 📄 License @@ -94,4 +105,4 @@ This project may contain trademarks or logos for projects, products, or services trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. -Any use of third-party trademarks or logos are subject to those third-party's policies. \ No newline at end of file +Any use of third-party trademarks or logos are subject to those third-party's policies. diff --git a/SUPPORT.md b/SUPPORT.md index 72edc54..a7dd53c 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,15 +1,15 @@ -# Support - -## How to file issues and get help - -This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue. - -For help or questions about using this project, please raise an issue on GitHub. - -Please include one of the following statements file: - -- **Awesome Copilot Prompts** is under active development and maintained by GitHub and Microsoft staff **AND THE COMMUNITY**. We will do our best to respond to support, feature requests, and community questions in a timely manner. -- -## GitHub Support Policy - -Support for this project is limited to the resources listed above. +# Support + +## How to file issues and get help + +This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue. + +For help or questions about using this project, please raise an issue on GitHub. + +Please include one of the following statements file: + +- **Awesome Copilot Prompts** is under active development and maintained by GitHub and Microsoft staff **AND THE COMMUNITY**. We will do our best to respond to support, feature requests, and community questions in a timely manner. +- +## GitHub Support Policy + +Support for this project is limited to the resources listed above. diff --git a/scripts/fix-line-endings.sh b/scripts/fix-line-endings.sh new file mode 100755 index 0000000..de57f66 --- /dev/null +++ b/scripts/fix-line-endings.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Script to fix line endings in all markdown files + +echo "Normalizing line endings in markdown files..." + +# Find all markdown files and convert CRLF to LF +find . -name "*.md" -type f -exec sed -i 's/\r$//' {} \; + +echo "Done! All markdown files now have LF line endings."