.pre-commit-config.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. exclude: doc/en/example/py2py3/test_py2.py
  2. repos:
  3. - repo: https://github.com/psf/black
  4. rev: 19.10b0
  5. hooks:
  6. - id: black
  7. args: [--safe, --quiet]
  8. language_version: python3
  9. - repo: https://github.com/asottile/blacken-docs
  10. rev: v0.5.0
  11. hooks:
  12. - id: blacken-docs
  13. additional_dependencies: [black==19.3b0]
  14. language_version: python3
  15. - repo: https://github.com/pre-commit/pre-commit-hooks
  16. rev: v2.2.2
  17. hooks:
  18. - id: trailing-whitespace
  19. - id: end-of-file-fixer
  20. - id: fix-encoding-pragma
  21. - id: check-yaml
  22. - id: debug-statements
  23. exclude: _pytest/debugging.py
  24. language_version: python3
  25. - repo: https://gitlab.com/pycqa/flake8
  26. rev: 3.7.7
  27. hooks:
  28. - id: flake8
  29. language_version: python3
  30. - repo: https://github.com/asottile/reorder_python_imports
  31. rev: v1.4.0
  32. hooks:
  33. - id: reorder-python-imports
  34. args: ['--application-directories=.:src']
  35. - repo: https://github.com/asottile/pyupgrade
  36. rev: v1.15.0
  37. hooks:
  38. - id: pyupgrade
  39. args: [--keep-percent-format]
  40. - repo: https://github.com/pre-commit/pygrep-hooks
  41. rev: v1.3.0
  42. hooks:
  43. - id: rst-backticks
  44. - repo: local
  45. hooks:
  46. - id: rst
  47. name: rst
  48. entry: rst-lint --encoding utf-8
  49. files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|TIDELIFT.rst|changelog/.*)$
  50. language: python
  51. additional_dependencies: [pygments, restructuredtext_lint]
  52. - id: changelogs-rst
  53. name: changelog filenames
  54. language: fail
  55. entry: 'changelog files must be named ####.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst'
  56. exclude: changelog/(\d+\.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
  57. files: ^changelog/
  58. - id: py-deprecated
  59. name: py library is deprecated
  60. language: pygrep
  61. entry: >
  62. (?x)\bpy\.(
  63. _code\.|
  64. builtin\.|
  65. code\.|
  66. io\.(BytesIO|saferepr)|
  67. path\.local\.sysfind|
  68. process\.|
  69. std\.
  70. )
  71. types: [python]