Add check to ensure error code explanations are not removed anymore even if not emitted
This commit is contained in:
parent
1aa6c7cbc6
commit
13bdc5c2be
3 changed files with 22 additions and 0 deletions
|
@ -28,6 +28,7 @@ COPY scripts/sccache.sh /scripts/
|
||||||
RUN sh /scripts/sccache.sh
|
RUN sh /scripts/sccache.sh
|
||||||
|
|
||||||
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
|
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
|
||||||
|
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
|
||||||
|
|
||||||
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
|
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
|
||||||
ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
|
ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
|
||||||
|
@ -37,6 +38,7 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
|
||||||
python3 ../x.py test --stage 2 src/tools/tidy && \
|
python3 ../x.py test --stage 2 src/tools/tidy && \
|
||||||
python3 ../x.py doc --stage 0 library/test && \
|
python3 ../x.py doc --stage 0 library/test && \
|
||||||
/scripts/validate-toolstate.sh && \
|
/scripts/validate-toolstate.sh && \
|
||||||
|
/scripts/validate-error-codes.sh && \
|
||||||
# Runs checks to ensure that there are no ES5 issues in our JS code.
|
# Runs checks to ensure that there are no ES5 issues in our JS code.
|
||||||
es-check es5 ../src/librustdoc/html/static/*.js && \
|
es-check es5 ../src/librustdoc/html/static/*.js && \
|
||||||
eslint ../src/librustdoc/html/static/*.js
|
eslint ../src/librustdoc/html/static/*.js
|
||||||
|
|
15
src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh
Executable file
15
src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Checks that no error code explanation is removed.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
echo "Check if an error code explanation was removed..."
|
||||||
|
|
||||||
|
if (git diff "$BASE_COMMIT" --name-status | grep '^D' \
|
||||||
|
| grep --quiet "compiler/rustc_error_codes/src/error_codes/"); then
|
||||||
|
echo "Error code explanations should never be removed!"
|
||||||
|
echo "Take a look at E0001 to see how to handle it."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "No error code explanation was removed!"
|
|
@ -219,6 +219,10 @@ else
|
||||||
command="/checkout/src/ci/run.sh"
|
command="/checkout/src/ci/run.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Get some needed information for $BASE_COMMIT
|
||||||
|
git fetch "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF"
|
||||||
|
BASE_COMMIT="$(git merge-base FETCH_HEAD HEAD)"
|
||||||
|
|
||||||
docker \
|
docker \
|
||||||
run \
|
run \
|
||||||
--workdir /checkout/obj \
|
--workdir /checkout/obj \
|
||||||
|
@ -237,6 +241,7 @@ docker \
|
||||||
--env TOOLSTATE_PUBLISH \
|
--env TOOLSTATE_PUBLISH \
|
||||||
--env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
|
--env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
|
||||||
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
|
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
|
||||||
|
--env BASE_COMMIT="$BASE_COMMIT" \
|
||||||
--init \
|
--init \
|
||||||
--rm \
|
--rm \
|
||||||
rust-ci \
|
rust-ci \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue