From 18e39645e1fd4122439cffddfc5dc2a9bfa80065 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Fri, 29 Nov 2024 03:27:52 +0000 Subject: [PATCH] ci(tools): `just submodules` clean git repos (#7530) [update_fixtures.js](https://github.com/oxc-project/oxc/blob/defaf4bf2b85a011f977dfa23b14312500875555/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. --- justfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 5d60c1d9e..adf4a51d5 100755 --- a/justfile +++ b/justfile @@ -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)