8000 Change trigger for autoformat, use --all-files (#153289) · pytorch/pytorch@b8fad78 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8fad78

Browse files
clee2000pytorchmergebot
authored andcommitted
Change trigger for autoformat, use --all-files (#153289)
Change trigger for auto format to be pull_request b/c the reusable action used gets the pr number from the pull_request event context, but only run it if ciflow/autoformat is attached to the PR. Tested this on a different PR, and it seems to be working Changed tag name because ciflow prefixed labels have special handling Also change to run on all files so it will mimic the normal CI lintrunner call, and because lintrunner, either by itself or using -m mergebase can miss some things. Idk if it would miss for format, but it does for checking lint. Format seems to take shorter than normal lint. I don't know if the comment about making suggestions on non edited file changes is a concern. I didn't really test this part Pull Request resolved: #153289 Approved by: https://github.com/atalman, https://github.com/malfet
1 parent 90deff6 commit b8fad78

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.github/pytorch-probot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ ciflow_push_tags:
2525
- ciflow/unstable
2626
- ciflow/xpu
2727
- ciflow/torchbench
28-
- ciflow/autoformat
2928
- ciflow/op-benchmark
3029
- ciflow/pull
3130
- ciflow/h100

.github/workflows/lint-autoformat.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
name: Apply lint suggestions
22

33
on:
4-
5-
push:
6-
tags:
7-
- ciflow/autoformat/*
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
86

97
jobs:
108
lintrunner-autoformat:
119
permissions:
1210
contents: read
1311
pull-requests: write
1412
runs-on: lf.linux.2xlarge
15-
if: ${{ github.repository_owner == 'pytorch' && github.event.pull_request.user.login != 'ezyang' && github.event.pull_request.user.login != 'malfet' && !startsWith(github.head_ref, 'export-') }}
13+
if: ${{ github.repository_owner == 'pytorch' && contains(github.event.pull_request.labels.*.name, 'autoformat') }}
1614
steps:
1715
- name: Checkout pytorch
1816
uses: pytorch/pytorch/.github/actions/checkout-pytorch@main
@@ -21,12 +19,11 @@ jobs:
2119
fetch-depth: 0
2220
- name: Run lintrunner (nonretryable)
2321
continue-on-error: true
24-
# we can't run all files here because only changes around where the diff are shown in the PR UI
2522
run: |
2623
set -ex
2724
python3 -m venv /tmp/venv
2825
source /tmp/venv/bin/activate
29-
export ADDITIONAL_LINTRUNNER_ARGS="format"
26+
export ADDITIONAL_LINTRUNNER_ARGS="format --all-files"
3027
bash .github/scripts/lintrunner.sh
3128
- name: Check for changes
3229
id: git-check

0 commit comments

Comments
 (0)
0