mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: Changes including: - introduced `linter/`, `testing/`, `stats/` folders in `tools/` - move appropriate scripts into these folders - change grepped references in the pytorch/pytorch repo Next step - introduce `build/` folder for build scripts Pull Request resolved: https://github.com/pytorch/pytorch/pull/60473 Test Plan: - CI (this is important b/c pytorch/test-infra also rely on some script reference. - tools/tests/ Reviewed By: albanD Differential Revision: D29352716 Pulled By: walterddr fbshipit-source-id: bad40b5ce130b35dfd9e59b8af34f9025f3285fd
26 lines
724 B
Bash
Executable File
26 lines
724 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Running pre-commit flake8"
|
|
python tools/linter/flake8_hook.py
|
|
|
|
if [ $(which clang-tidy) ]
|
|
then
|
|
echo "Running pre-commit clang-tidy"
|
|
python tools/linter/clang_tidy.py \
|
|
--paths torch/csrc \
|
|
--diff HEAD \
|
|
-g"-torch/csrc/jit/passes/onnx/helper.cpp" \
|
|
-g"-torch/csrc/jit/passes/onnx/shape_type_inference.cpp" \
|
|
-g"-torch/csrc/jit/serialization/onnx.cpp" \
|
|
-g"-torch/csrc/jit/serialization/export.cpp" \
|
|
-g"-torch/csrc/jit/serialization/import.cpp" \
|
|
-j
|
|
else
|
|
echo "WARNING: Couldn't find clang-tidy executable."
|
|
echo " Please install it if you want local clang-tidy checks."
|
|
fi
|
|
|
|
echo "Running pre-commit clang-format"
|
|
tools/linter/git-clang-format HEAD~ --force
|