]> git.lizzy.rs Git - rust.git/blobdiff - .github/workflows/clippy_bors.yml
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / .github / workflows / clippy_bors.yml
index 9d24b0293c4a73d156dcc0e7cb2465b20417d460..1f4d666c7a92c1f6761c2288a280c71ad586f2c3 100644 (file)
@@ -34,15 +34,16 @@ jobs:
       run: |
         MESSAGE=$(git log --format=%B -n 1)
         PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
-        output=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
-          python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \
-          grep "^changelog: " | \
-          sed "s/changelog: //g")
-        if [[ -z "$output" ]]; then
+        body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
+          python -c "import sys, json; print(json.load(sys.stdin)['body'])")
+        output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
           echo "ERROR: PR body must contain 'changelog: ...'"
           exit 1
-        elif [[ "$output" = "none" ]]; then
+        }
+        if [[ "$output" = "none" ]]; then
           echo "WARNING: changelog is 'none'"
+        else
+          echo "changelog: $output"
         fi
       env:
         PYTHONIOENCODING: 'utf-8'
@@ -72,6 +73,7 @@ jobs:
 
     runs-on: ${{ matrix.os }}
 
+    # NOTE: If you modify this job, make sure you copy the changes to clippy.yml
     steps:
     # Setup
     - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
@@ -110,10 +112,18 @@ jobs:
         echo "$SYSROOT/bin" >> $GITHUB_PATH
 
     - name: Build
-      run: cargo build --features deny-warnings,internal-lints
+      run: cargo build --features deny-warnings,internal-lints,metadata-collector-lint
 
-    - name: Test Workspace
-      run: cargo test --all --features deny-warnings,internal-lints
+    - name: Test
+      run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
+
+    - name: Test clippy_lints
+      run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
+      working-directory: clippy_lints
+
+    - name: Test rustc_tools_util
+      run: cargo test --features deny-warnings
+      working-directory: rustc_tools_util
 
     - name: Test clippy_dev
       run: cargo test --features deny-warnings
@@ -123,11 +133,22 @@ jobs:
       run: ../target/debug/cargo-clippy
       working-directory: clippy_workspace_tests
 
+    - name: Test cargo-clippy --fix
+      run: ../target/debug/cargo-clippy clippy --fix
+      working-directory: clippy_workspace_tests
+
     - name: Test clippy-driver
       run: bash .github/driver.sh
       env:
         OS: ${{ runner.os }}
 
+    - name: Test cargo dev new lint
+      run: |
+        cargo dev new_lint --name new_early_pass --pass early
+        cargo dev new_lint --name new_late_pass --pass late
+        cargo check
+        git reset --hard HEAD
+
   integration_build:
     needs: changelog
     runs-on: ubuntu-latest