diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8543175 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[*.{bat,cmd}] +end_of_line = crlf + +[*.{yml,yaml}] +indent_size = 2 + +[*.json] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9d5a9b5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,50 @@ +# Set default line ending behavior to auto normalize line endings +* text=auto + +# Documents +*.md text eol=lf +*.txt text eol=lf + +# Source code +*.js text eol=lf +*.jsx text eol=lf +*.ts text eol=lf +*.tsx text eol=lf +*.json text eol=lf +*.css text eol=lf +*.scss text eol=lf +*.html text eol=lf +*.xml text eol=lf +*.yml text eol=lf +*.yaml text eol=lf + +# Configuration files +*.config.js text eol=lf +*.config.ts text eol=lf +*.config.mjs text eol=lf +.prettierrc text eol=lf +.eslintrc* text eol=lf +.gitignore text eol=lf +.gitattributes text eol=lf + +# Shell scripts (Unix line endings) +*.sh text eol=lf + +# Batch files (Windows line endings) +*.bat text eol=crlf +*.cmd text eol=crlf + +# Binary files +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.woff binary +*.woff2 binary +*.ttf binary +*.eot binary +*.otf binary +*.pdf binary +*.zip binary +*.tar.gz binary diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 249f79e..7c05875 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -16,6 +16,10 @@ jobs: copilot-setup-steps: runs-on: ubuntu-latest + # Disable Git hooks (Husky) in CI to avoid running pre-commit/commit-msg hooks + env: + HUSKY: '0' + # Set the permissions to the lowest permissions possible needed for your steps. # Copilot will be given its own token for its operations. permissions: diff --git a/.husky/commit-msg b/.husky/commit-msg index 28e9b3b..3856a72 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,3 +1,11 @@ +#!/usr/bin/env sh + +# Skip Husky commit-msg when running in CI (e.g., GitHub Actions) +if [ "$GITHUB_ACTIONS" = "true" ] || [ "$CI" = "true" ]; then + echo "â„šī¸ Skipping commit-msg hook in CI environment" + exit 0 +fi + echo "🔍 Checking commit message format..." # Run commitlint to validate commit message against conventional commits diff --git a/.husky/pre-commit b/.husky/pre-commit index 141342a..ecaff60 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,11 @@ +#!/usr/bin/env sh + +# Skip Husky hooks when running in CI (e.g., GitHub Actions) +if [ "$GITHUB_ACTIONS" = "true" ] || [ "$CI" = "true" ]; then + echo "â„šī¸ Skipping pre-commit hook in CI environment" + exit 0 +fi + echo "🔍 Running pre-commit checks..." # Use the check script for consistency diff --git a/.prettierrc b/.prettierrc index fce835d..03ef21f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,7 @@ "printWidth": 100, "tabWidth": 2, "useTabs": false, - "endOfLine": "lf", + "endOfLine": "auto", "arrowParens": "avoid", "bracketSpacing": true, "jsxSingleQuote": true, diff --git a/commitlint.config.js b/commitlint.config.js index 7c4ff4d..ba7f70b 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,29 @@ -export default { extends: ['@commitlint/config-conventional'] } +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [ + 2, + 'always', + [ + 'feat', + 'fix', + 'docs', + 'style', + 'refactor', + 'perf', + 'test', + 'chore', + 'ci', + 'build', + 'revert', + ], + ], + 'type-case': [2, 'always', 'lower-case'], + 'type-empty': [2, 'never'], + 'scope-case': [2, 'always', 'lower-case'], + 'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']], + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'header-max-length': [2, 'always', 100], + }, +}