The Python package installer https://pip.pypa.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

105 lines
2.5 KiB

  1. exclude: 'src/pip/_vendor/'
  2. repos:
  3. - repo: https://github.com/pre-commit/pre-commit-hooks
  4. rev: v3.2.0
  5. hooks:
  6. - id: check-builtin-literals
  7. - id: check-added-large-files
  8. - id: check-case-conflict
  9. - id: check-toml
  10. - id: check-yaml
  11. - id: debug-statements
  12. - id: end-of-file-fixer
  13. exclude: WHEEL
  14. - id: forbid-new-submodules
  15. - id: trailing-whitespace
  16. exclude: .patch
  17. - repo: https://github.com/psf/black
  18. rev: 20.8b1
  19. hooks:
  20. - id: black
  21. exclude: |
  22. (?x)
  23. ^docs/|
  24. ^src/pip/_internal/cli|
  25. ^src/pip/_internal/commands|
  26. ^src/pip/_internal/distributions|
  27. ^src/pip/_internal/index|
  28. ^src/pip/_internal/models|
  29. ^src/pip/_internal/network|
  30. ^src/pip/_internal/operations|
  31. ^src/pip/_internal/req|
  32. ^src/pip/_internal/resolution|
  33. ^src/pip/_internal/utils|
  34. ^src/pip/_internal/vcs|
  35. ^src/pip/_internal/\w+\.py$|
  36. ^src/pip/__main__.py$|
  37. ^tools/|
  38. # Tests
  39. ^tests/conftest.py|
  40. ^tests/yaml|
  41. ^tests/lib|
  42. ^tests/data|
  43. ^tests/unit|
  44. ^tests/functional/(?!test_install)|
  45. ^tests/functional/test_install|
  46. # Files in the root of the repository
  47. ^setup.py|
  48. ^noxfile.py|
  49. # A blank ignore, to avoid merge conflicts later.
  50. ^$
  51. - repo: https://gitlab.com/pycqa/flake8
  52. rev: 3.8.3
  53. hooks:
  54. - id: flake8
  55. additional_dependencies: [
  56. 'flake8-bugbear==20.1.4',
  57. 'flake8-logging-format==0.6.0',
  58. ]
  59. exclude: tests/data
  60. - repo: https://github.com/timothycrosley/isort
  61. rev: 5.5.3
  62. hooks:
  63. - id: isort
  64. files: \.py$
  65. - repo: https://github.com/pre-commit/mirrors-mypy
  66. rev: v0.790
  67. hooks:
  68. - id: mypy
  69. exclude: docs|tests
  70. args: ["--pretty"]
  71. - id: mypy
  72. name: mypy, for Python 2
  73. exclude: noxfile.py|tools/automation/release|docs|tests
  74. args: ["--pretty", "-2"]
  75. - repo: https://github.com/pre-commit/pygrep-hooks
  76. rev: v1.6.0
  77. hooks:
  78. - id: python-no-log-warn
  79. - id: python-no-eval
  80. - id: rst-backticks
  81. files: .*\.rst$
  82. types: [file]
  83. exclude: NEWS.rst # The errors flagged in NEWS.rst are old.
  84. - repo: local
  85. hooks:
  86. - id: news-fragment-filenames
  87. name: NEWS fragment
  88. language: fail
  89. entry: NEWS fragment files must be named *.(process|removal|feature|bugfix|vendor|doc|trivial).rst
  90. exclude: ^news/(.gitignore|.*\.(process|removal|feature|bugfix|vendor|doc|trivial).rst)
  91. files: ^news/
  92. - repo: https://github.com/mgedmin/check-manifest
  93. rev: '0.43'
  94. hooks:
  95. - id: check-manifest