@@ -223,68 +223,6 @@ run_test_coverage: &run_test_coverage
223223 - store_artifacts :
224224 path : htmlcov
225225
226- run_clang_format : &run_clang_format
227- name : Run clang-format
228- command : |
229- sudo apt-get update
230- sudo apt install -y clang-format-7
231- git_status=$(git status --porcelain)
232- if [[ $git_status ]]; then
233- echo "Checkout code is not clean"
234- echo "${git_status}"
235- exit 1
236- fi
237-
238- find -name '*.cpp' -o -name '*.h' -o -name '*.cc' | xargs clang-format-7 -i -style=file
239- git_status=$(git status --porcelain)
240- if [[ $git_status ]]; then
241- git diff
242- echo "clang-format-7 recommends the changes above, please manually apply them OR automatically apply the changes "
243- echo "by running \"clang-format-7 -i -style=file /PATH/TO/foo.cpp\" to the following files"
244- echo "${git_status}"
245- exit 1
246- else
247- echo "PASSED C++ format"
248- fi
249-
250- run_yapf : &run_yapf
251- name : Run yapf
252- command : |
253- pyenv install 3.7.0
254- pyenv global 3.7.0
255- pip install --upgrade pip
256- pip install yapf==0.30.0
257-
258- git_status=$(git status --porcelain)
259- if [[ $git_status ]]; then
260- echo "Checkout code is not clean"
261- echo "${git_status}"
262- exit 1
263- fi
264-
265- yapf -i -r *.py test/ scripts/ torch_xla/
266- git_status=$(git status --porcelain)
267- if [[ $git_status ]]; then
268- git diff
269- echo "yapf recommends the changes above, please manually apply them OR automatically apply the changes "
270- echo "by running `yapf -i /PATH/TO/foo.py` to the following files"
271- echo "${git_status}"
272- exit 1
273- else
274- echo "PASSED Python format"
275- fi
276-
277- assert_no_torch_pin : &assert_no_torch_pin
278- name : Make sure torch_patches/.torch_pin is removed before merging
279- command : |
280- TORCH_PIN=./torch_patches/.torch_pin
281- if [[ -f "${TORCH_PIN}" ]]; then
282- echo "Please remove ${TORCH_PIN} before landing."
283- exit 1
284- else
285- echo "No ${TORCH_PIN} found, safe to land..."
286- fi
287-
288226assert_continue_on_error_is_false : &assert_continue_on_error_is_false
289227 name : Make sure CONTINUE_ON_ERROR flags are set to false before merging
290228 command : |
@@ -314,28 +252,6 @@ ci_params: &ci_params
314252 resource_class : << parameters.resource_class >>
315253
316254jobs :
317- linter_check :
318- machine :
319- image : ubuntu-2004:202111-02
320- steps :
321- - checkout
322- - run :
323- << : *run_clang_format
324- - run :
325- << : *run_yapf
326-
327- linter_check_no_torch_pin :
328- machine :
329- image : ubuntu-2004:202111-02
330- steps :
331- - checkout
332- - run :
333- << : *assert_no_torch_pin
334- - run :
335- << : *run_clang_format
336- - run :
337- << : *run_yapf
338-
339255 continue_on_error_is_false :
340256 machine :
341257 image : ubuntu-2004:202111-02
@@ -362,18 +278,6 @@ jobs:
362278workflows :
363279 build :
364280 jobs :
365- - linter_check :
366- filters :
367- branches :
368- ignore :
369- - master
370- - ^r\d*\.?\d*$
371- - linter_check_no_torch_pin :
372- filters :
373- branches :
374- only :
375- - master
376- - ^r\d*\.?\d*$
377281 - pytorch_xla_run_build
378282 - pytorch_xla_run_test :
379283 name : pytorch_xla_run_CPU_test
0 commit comments