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.

99 lines
3.0 KiB

  1. exclude: |
  2. (?x)
  3. # Files and folders generated by bots, to avoid loops
  4. ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$|
  5. # Maybe reactivate this when all README files include prettier ignore tags?
  6. ^README\.md$|
  7. # Library files can have extraneous formatting (even minimized)
  8. /static/(src/)?lib/|
  9. # Repos using Sphinx to generate docs don't need prettying
  10. ^docs/_templates/.*\.html$|
  11. # You don't usually want a bot to modify your legal texts
  12. (LICENSE.*|COPYING.*)
  13. default_language_version:
  14. python: python3
  15. repos:
  16. - repo: https://github.com/myint/autoflake
  17. rev: v1.4
  18. hooks:
  19. - id: autoflake
  20. args: ["-i", "--ignore-init-module-imports"]
  21. - repo: https://github.com/psf/black
  22. rev: 20.8b1
  23. hooks:
  24. - id: black
  25. - repo: https://github.com/pre-commit/mirrors-prettier
  26. rev: v2.1.2
  27. hooks:
  28. - id: prettier
  29. name: prettier + plugin-xml
  30. additional_dependencies:
  31. - "prettier@2.1.2"
  32. - "@prettier/plugin-xml@0.12.0"
  33. args:
  34. - --plugin=@prettier/plugin-xml
  35. - repo: https://github.com/pre-commit/mirrors-eslint
  36. rev: v7.8.1
  37. hooks:
  38. - id: eslint
  39. verbose: true
  40. args:
  41. - --color
  42. - --fix
  43. - repo: https://github.com/pre-commit/pre-commit-hooks
  44. rev: v2.4.0
  45. hooks:
  46. - id: trailing-whitespace
  47. # exclude autogenerated files
  48. exclude: /README\.rst$
  49. - id: end-of-file-fixer
  50. # exclude autogenerated files
  51. exclude: /README\.rst$
  52. - id: debug-statements
  53. - id: fix-encoding-pragma
  54. args: ["--remove"]
  55. - id: check-case-conflict
  56. - id: check-docstring-first
  57. - id: check-executables-have-shebangs
  58. - id: check-merge-conflict
  59. - id: check-symlinks
  60. - id: check-xml
  61. - id: mixed-line-ending
  62. args: ["--fix=lf"]
  63. - repo: https://github.com/PyCQA/pylint
  64. rev: pylint-2.5.3
  65. hooks:
  66. - id: pylint
  67. name: pylint with optional checks
  68. args: ["--rcfile=.pylintrc", "--exit-zero"]
  69. verbose: true
  70. additional_dependencies: &pylint_deps
  71. - pylint-odoo==3.5.0
  72. - id: pylint
  73. name: pylint with mandatory checks
  74. args: ["--rcfile=.pylintrc-mandatory"]
  75. additional_dependencies: *pylint_deps
  76. - repo: https://github.com/asottile/pyupgrade
  77. rev: v1.26.2
  78. hooks:
  79. - id: pyupgrade
  80. - repo: https://gitlab.com/PyCQA/flake8
  81. rev: 3.8.3
  82. hooks:
  83. - id: flake8
  84. name: flake8 except __init__.py
  85. exclude: /__init__\.py$
  86. additional_dependencies: ["flake8-bugbear==20.1.4"]
  87. - id: flake8
  88. name: flake8 only __init__.py
  89. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  90. files: /__init__\.py$
  91. additional_dependencies: ["flake8-bugbear==20.1.4"]
  92. - repo: https://github.com/PyCQA/isort
  93. rev: 5.5.1
  94. hooks:
  95. - id: isort
  96. name: isort except __init__.py
  97. args:
  98. - --settings=.
  99. exclude: /__init__\.py$