Skip to content

Commit 8476749

Browse files
Fcursoragent
andcommitted
chore: align EditorConfig with LF and lint conventions
Use LF/UTF-8 to match .gitattributes and format tooling, set file-type indents for PowerShell/YAML/JSON/markdown, and fix commit-msg hook path resolution so commits can finish. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 158d824 commit 8476749

27 files changed

Lines changed: 389 additions & 143 deletions

.editorconfig

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,80 @@
1+
# https://editorconfig.org
2+
# Keep in sync with .gitattributes (LF), run-format.ps1 (UTF-8 / LF),
3+
# PSScriptAnalyzerSettings.psd1 (no BOM required), .vscode/settings.json,
4+
# and .markdownlint.json (MD013 line_length 200).
5+
16
root = true
27

38
[*]
49
charset = utf-8
5-
end_of_line = crlf
10+
end_of_line = lf
611
insert_final_newline = true
712
trim_trailing_whitespace = true
8-
9-
[*.ps1]
1013
indent_style = space
1114
indent_size = 4
1215

13-
[*.psd1]
16+
# PowerShell — 4-space indent (VS Code editor.tabSize + Invoke-Formatter)
17+
[*.{ps1,psm1,psd1,ps1xml,pssc,psrc}]
1418
indent_style = space
1519
indent_size = 4
1620

21+
# YAML / Taskfile / GitHub Actions — 2-space indent
22+
[*.{yml,yaml}]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[{Taskfile.yml,Taskfile.yaml,.github/workflows/**}]
27+
indent_style = space
28+
indent_size = 2
29+
30+
# JSON (package.json, cspell, VS Code) — 2-space indent
31+
[*.json]
32+
indent_style = space
33+
indent_size = 2
34+
35+
[{.vscode/**,.markdownlint.json,cspell.json,cspell*.json}]
36+
indent_style = space
37+
indent_size = 2
38+
39+
# Markdown — MD013 line_length 200; keep trailing spaces (hard line breaks)
1740
[*.md]
41+
indent_style = space
42+
indent_size = 2
1843
trim_trailing_whitespace = false
44+
max_line_length = 200
1945

20-
[*.yml]
46+
# Just recipes use 4-space bodies (see justfile)
47+
[{justfile,Justfile,*.just}]
48+
indent_style = space
49+
indent_size = 4
50+
51+
# Makefiles require tabs
52+
[{Makefile,makefile,*.mk}]
53+
indent_style = tab
54+
55+
# TOML / INI-style configs
56+
[*.{toml,ini}]
2157
indent_style = space
2258
indent_size = 2
2359

24-
[*.yaml]
60+
# Shell helpers shipped beside PowerShell tooling
61+
[*.{sh,bash}]
2562
indent_style = space
26-
indent_size = 2
63+
indent_size = 2
64+
end_of_line = lf
65+
66+
# Lockfiles and generated blobs — do not reformat on save
67+
[{pnpm-lock.yaml,package-lock.json,yarn.lock,**/docs/api/**,**/docs/test-verification-reports/**}]
68+
indent_style = unset
69+
indent_size = unset
70+
trim_trailing_whitespace = unset
71+
insert_final_newline = unset
72+
max_line_length = unset
73+
74+
[*.{svg,png,jpg,jpeg,gif,webp,ico,woff,woff2,ttf,eot}]
75+
charset = unset
76+
end_of_line = unset
77+
insert_final_newline = unset
78+
trim_trailing_whitespace = unset
79+
indent_style = unset
80+
indent_size = unset

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
*.yaml text eol=lf
1414
*.toml text eol=lf
1515
*.psrc text eol=lf
16+
*.jsonc text eol=lf
17+
.editorconfig text eol=lf
18+
justfile text eol=lf
19+
Justfile text eol=lf
20+
Makefile text eol=lf
21+
*.mk text eol=lf

.vscode/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@
3737
"**/.git": true
3838
},
3939

40+
// Match .editorconfig / .gitattributes (LF, UTF-8, no BOM)
41+
"files.encoding": "utf8",
42+
"files.eol": "\n",
43+
"files.insertFinalNewline": true,
44+
"files.trimTrailingWhitespace": true,
45+
"[markdown]": {
46+
"files.trimTrailingWhitespace": false
47+
},
48+
"[yaml]": {
49+
"editor.tabSize": 2,
50+
"editor.insertSpaces": true
51+
},
52+
"[json]": {
53+
"editor.tabSize": 2,
54+
"editor.insertSpaces": true
55+
},
56+
"[jsonc]": {
57+
"editor.tabSize": 2,
58+
"editor.insertSpaces": true
59+
},
60+
4061
// Editor settings
4162
"editor.insertSpaces": true,
4263
"editor.tabSize": 4,

Taskfile.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ tasks:
329329
cmds:
330330
- pwsh -NoProfile -File scripts/git/pre-commit.ps1
331331

332+
pre-push-checks:
333+
desc: Run Pre-push Checks (validate + changed CI Pester shards)
334+
cmds:
335+
- pwsh -NoProfile -File scripts/git/hooks/pre-push.ps1 {{.CLI_ARGS}}
336+
332337
check-idempotency:
333338
desc: Check Idempotency
334339
cmds:

docs/guides/TESTING.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,16 @@ pwsh -NoProfile -File scripts/utils/code-quality/run-pester-changed-shards.ps1 -
635635
pwsh -NoProfile -File scripts/utils/code-quality/run-pester-changed-shards.ps1 -ListOnly
636636
```
637637

638-
Pre-push can opt into the same run with `PS_PROFILE_PUSH_TESTS=1` (optional
639-
`PS_PROFILE_PUSH_TESTS_SINCE=origin/main`). Pre-commit stays format + validate only.
638+
Pre-push runs the same changed-shard filters by default (after validate-profile with
639+
cspell/markdownlint gating). Opt out with `PS_PROFILE_SKIP_PUSH_TESTS=1` or
640+
`PS_PROFILE_PUSH_TESTS=0`. Override the diff base with
641+
`PS_PROFILE_PUSH_TESTS_SINCE=origin/main`. Pre-commit stays format + validate only.
642+
643+
```bash
644+
just pre-push-checks
645+
# or
646+
pwsh -NoProfile -File scripts/git/hooks/pre-push.ps1
647+
```
640648

641649
Each enabled shard is a bounded path set executed via `run-pester-ci-shard.ps1`:
642650

justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ quality-check format security-scan lint spellcheck markdownlint check-comment-he
198198
pre-commit-checks:
199199
pwsh -NoProfile -File scripts/git/pre-commit.ps1
200200

201+
# Run Pre-push Checks (validate + changed CI Pester shards)
202+
pre-push-checks *ARGS:
203+
pwsh -NoProfile -File scripts/git/hooks/pre-push.ps1 {{ ARGS }}
204+
201205
# Check Idempotency
202206
check-idempotency:
203207
pwsh -NoProfile -File scripts/checks/check-idempotency.ps1

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"track-coverage-trends": "pwsh -NoProfile -File scripts/utils/metrics/track-coverage-trends.ps1",
6666
"quality-check": "pnpm run format && pnpm run security-scan && pnpm run lint && pnpm run spellcheck && pnpm run markdownlint && pnpm run check-comment-help && pnpm run test && pnpm run validate-function-naming && pnpm run drift-check && echo All quality checks passed",
6767
"pre-commit-checks": "pwsh -NoProfile -File scripts/git/pre-commit.ps1",
68+
"pre-push-checks": "pwsh -NoProfile -File scripts/git/hooks/pre-push.ps1",
6869
"check-idempotency": "pwsh -NoProfile -File scripts/checks/check-idempotency.ps1",
6970
"validate-function-naming": "pwsh -NoProfile -File scripts/utils/code-quality/validate-function-naming.ps1",
7071
"check-missing-tests": "pwsh -NoProfile -File scripts/utils/code-quality/check-missing-tests.ps1",

profile.d/3d-cad.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,3 @@ catch {
616616
}
617617
}
618618
}
619-

profile.d/ansible.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Determine invocation strategy once at load time
2626
$script:_ansibleIsLinux = $IsLinux -or $IsMacOS
27-
$script:_ansibleHasWsl = -not $script:_ansibleIsLinux -and (Test-CachedCommand 'wsl')
27+
$script:_ansibleHasWsl = -not $script:_ansibleIsLinux -and (Test-CachedCommand 'wsl')
2828

2929
# On Windows without WSL there is nothing to register — show install hint and bail out
3030
if (-not $script:_ansibleIsLinux -and -not $script:_ansibleHasWsl) {

profile.d/database.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,4 +958,3 @@ Set-AgentModeAlias -Name 'db-import' -Target 'Import-Database'
958958
Set-AgentModeAlias -Name 'db-backup' -Target 'Backup-Database'
959959
Set-AgentModeAlias -Name 'db-restore' -Target 'Restore-Database'
960960
Set-AgentModeAlias -Name 'db-schema' -Target 'Get-DatabaseSchema'
961-

0 commit comments

Comments
 (0)