.pre-commit-config.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. repos:
  2. - repo: meta
  3. hooks:
  4. - id: check-hooks-apply
  5. - id: check-useless-excludes
  6. - repo: https://github.com/pre-commit/pre-commit-hooks
  7. rev: v4.0.1
  8. hooks:
  9. - id: check-case-conflict
  10. - id: check-json
  11. - id: check-symlinks
  12. - id: check-yaml
  13. - id: destroyed-symlinks
  14. - id: end-of-file-fixer
  15. exclude: docs/CNAME
  16. - id: fix-byte-order-marker
  17. - id: fix-encoding-pragma
  18. args: [--remove]
  19. - id: mixed-line-ending
  20. args: [--fix=lf]
  21. - id: requirements-txt-fixer
  22. - id: trailing-whitespace
  23. - repo: https://github.com/pre-commit/mirrors-yapf
  24. rev: v0.31.0
  25. hooks:
  26. - id: yapf
  27. - repo: https://gitlab.com/daverona/pre-commit-cpp
  28. rev: 0.8.0
  29. hooks:
  30. - id: clang-format # formatter of C/C++ code based on a style guide: LLVM, Google, Chromium, Mozilla, and WebKit available
  31. args: []
  32. - repo: local
  33. hooks:
  34. - id: check-torchdist
  35. name: check-torchdist
  36. entry: ./scripts/check-torchdist.py
  37. language: script
  38. exclude: ^(deepspeed/comm/|docs/|benchmarks/|scripts/check-torchdist.py|deepspeed/moe/sharded_moe.py|deepspeed/runtime/comm/coalesced_collectives.py|deepspeed/elasticity/elastic_agent.py|deepspeed/launcher/launch.py|tests/unit/comm/test_dist.py)
  39. # Specific deepspeed/ files are excluded for now until we wrap ProcessGroup in deepspeed.comm
  40. - repo: https://github.com/codespell-project/codespell
  41. rev: v2.1.0
  42. hooks:
  43. - id: codespell
  44. args: [
  45. # Do not check files that are automatically generated
  46. '--skip=docs/Gemfile.lock,tests/unit/gpt2-merges.txt,tests/unit/gpt2-vocab.json',
  47. '--ignore-regex=\\n', # Do not count the 'n' in an escaped newline as part of a word
  48. '--ignore-words-list=unsupport', # Word used in error messages that need rewording
  49. --check-filenames,
  50. --check-hidden
  51. ]
  52. - repo: https://github.com/pycqa/flake8
  53. rev: 4.0.1
  54. hooks:
  55. - id: flake8
  56. args: ['--ignore=E,F403,F405,F541,F841,W', '--select=E9,F,W6', '--per-file-ignores=__init__.py:F401']