You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

linter.sh 884 B

3 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash -e
  2. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
  3. # Run this script at project root by "./dev/linter.sh" before you commit
  4. {
  5. black --version | grep "19.3b0" > /dev/null
  6. } || {
  7. echo "Linter requires black==19.3b0 !"
  8. exit 1
  9. }
  10. set -v
  11. echo "Running isort ..."
  12. isort -y --multi-line 3 --trailing-comma -sp . --skip datasets --skip docs --skip-glob '*/__init__.py' --atomic
  13. echo "Running black ..."
  14. black -l 100 .
  15. echo "Running flake8 ..."
  16. if [ -x "$(command -v flake8-3)" ]; then
  17. flake8-3 .
  18. else
  19. python3 -m flake8 .
  20. fi
  21. # echo "Running mypy ..."
  22. # Pytorch does not have enough type annotations
  23. # mypy detectron2/solver detectron2/structures detectron2/config
  24. echo "Running clang-format ..."
  25. find . -regex ".*\.\(cpp\|c\|cc\|cu\|cxx\|h\|hh\|hpp\|hxx\|tcc\|mm\|m\)" -print0 | xargs -0 clang-format -i
  26. command -v arc > /dev/null && arc lint

No Description