Skip to content

Commit a2fa41e

Browse files
lukekarryswraithgar
authored andcommittedJun 26, 2023
chore: normalize line endings and symlinks
This makes it possible to do a fresh clone of this repo in Windows, and be able to run the resetdeps command successfully and then have a clean git status. We now check for a clean git status in during CI in Windows which was previously excluded. The changes required were to: - Delete our workspace symlinks from node_modules and add a step to resetdeps that will do a platform dependent symlink before the initial reification - Add line ending normalization to our `.gitattributes` file and commit the result. Git will store text with LF line endings automatically, except for some files like `cmd` scripts that need to be `crlf` and shell scripts that need to be `lf`. - Update workflows to call `node scripts/resetdeps.js` directly since a fresh clone of the repo wont have any symlinks in place, so any `node .` command will fail due to missing workspaces. Ref: npm/statusboard#562
1 parent aef96c0 commit a2fa41e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+339
-246
lines changed
 

‎.gitattributes

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1-
/node_modules/** linguist-generated=false
2-
/package-lock.json linguist-generated=false
1+
# normalize all line endings by default
2+
* text=auto
3+
4+
# our shell/bin scripts always need to be LF
5+
/bin/* text eol=lf
6+
/workspaces/arborist/bin/index.js text eol=lf
7+
/configure text eol=lf
8+
9+
# our cmd scripts always need to be CRLF
10+
/bin/*.cmd text eol=crlf
11+
12+
# ignore all line endings in node_modules since we dont control that
13+
/node_modules/** -text
14+
15+
# the files we write should be LF so they can be generated cross platform
16+
/node_modules/.gitignore text eol=lf
17+
/workspaces/arborist/test/fixtures/.gitignore text eol=lf
18+
/DEPENDENCIES.md text eol=lf
19+
/AUTHORS text eol=lf
20+
21+
# fixture tarballs should be treated as binary
22+
/workspaces/*/test/fixtures/**/*.tgz binary
23+
24+
# these hint to GitHub to show these files as not generated so they default to
25+
# showing the full diff in pull requests
26+
/node_modules/** linguist-generated=false
27+
/package-lock.json linguist-generated=false

‎.github/workflows/audit.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ jobs:
2828
with:
2929
node-version: 18.x
3030
cache: npm
31+
- name: Check Git Status
32+
run: node scripts/git-dirty.js
3133
- name: Reset Deps
32-
run: node . run resetdeps -- --package-lock
34+
run: node scripts/resetdeps.js --package-lock
3335
- name: Run Production Audit
3436
run: node . audit --omit=dev
3537
- name: Run Full Audit

0 commit comments

Comments
 (0)
Please sign in to comment.