ci(tools): just submodules clean git repos (#7530)

[update_fixtures.js](defaf4bf2b/tasks/transform_conformance/update_fixtures.js)
script updates Babel test fixtures in place for class properties
transform.

When we update submodules, we want to re-run amending the fixtures,
starting afresh from the updated Babel submodule.

`git reset --hard` already gets rid of any changes that
`update_fixtures.js` had made to existing files, but it doesn't remove
new files the script had created. This PR adds `git clean` to the `just`
script to completely reset the submodule to fresh cloned state before
`update_fixtures.js` runs again.
This commit is contained in:
overlookmotel 2024-11-29 03:27:52 +00:00 committed by GitHub
parent defaf4bf2b
commit 18e39645e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,13 +201,13 @@ new-security-rule name:
clone-submodule dir url sha:
cd {{dir}} || git init {{dir}}
cd {{dir}} && git remote add origin {{url}} || true
cd {{dir}} && git fetch --depth=1 origin {{sha}} && git reset --hard {{sha}}
cd {{dir}} && git fetch --depth=1 origin {{sha}} && git reset --hard {{sha}} && git clean -f -q
[windows]
clone-submodule dir url sha:
if (-not (Test-Path {{dir}}/.git)) { git init {{dir}} }
cd {{dir}} ; if ((git remote) -notcontains 'origin') { git remote add origin {{url}} } else { git remote set-url origin {{url}} }
cd {{dir}} ; git fetch --depth=1 origin {{sha}} ; git reset --hard {{sha}}
cd {{dir}} ; git fetch --depth=1 origin {{sha}} ; git reset --hard {{sha}} ; git clean -f -q
website path:
cargo run -p website -- linter-rules --table {{path}}/src/docs/guide/usage/linter/generated-rules.md --rule-docs {{path}}/src/docs/guide/usage/linter/rules --git-ref $(git rev-parse HEAD)