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.

114 lines
3.3 KiB

  1. exclude: |
  2. # NOT INSTALLABLE ADDONS
  3. # END NOT INSTALLABLE ADDONS
  4. (?x)
  5. # Files and folders generated by bots, to avoid loops
  6. /static/description/index\.html$|
  7. # Library files can have extraneous formatting (even minimized)
  8. /static/(src/)?lib/|
  9. # You don't usually want a bot to modify your legal texts
  10. (LICENSE.*|COPYING.*)
  11. default_language_version:
  12. python: python3
  13. node: "14.14.0"
  14. repos:
  15. - repo: local
  16. hooks:
  17. - id: forbidden-files
  18. name: forbidden files
  19. entry: found forbidden files; remove them
  20. language: fail
  21. files: "\\.rej$"
  22. - repo: https://github.com/oca/maintainer-tools
  23. rev: b9c963d
  24. hooks:
  25. # update the NOT INSTALLABLE ADDONS section above
  26. - id: oca-update-pre-commit-excluded-addons
  27. args:
  28. - --addons-dir
  29. - odoo/custom/src/private
  30. - repo: https://github.com/psf/black
  31. rev: 20.8b1
  32. hooks:
  33. - id: black
  34. - repo: https://github.com/asottile/pyupgrade
  35. rev: v2.7.2
  36. hooks:
  37. - id: pyupgrade
  38. args:
  39. - --keep-percent-format
  40. - repo: https://github.com/timothycrosley/isort
  41. rev: 5.5.1
  42. hooks:
  43. - id: isort
  44. name: isort except __init__.py
  45. args: [--settings, .]
  46. exclude: /__init__\.py$
  47. - repo: https://github.com/pre-commit/mirrors-prettier
  48. rev: v2.1.2
  49. hooks:
  50. - id: prettier
  51. name: prettier + plugin-xml
  52. additional_dependencies:
  53. # HACK https://github.com/prettier/pre-commit/issues/16#issuecomment-713474520
  54. - prettier@2.1.2
  55. - "@prettier/plugin-xml@0.12.0"
  56. args:
  57. - --plugin=@prettier/plugin-xml
  58. - repo: https://github.com/pre-commit/pre-commit-hooks
  59. rev: v3.2.0
  60. hooks:
  61. - id: trailing-whitespace
  62. - id: end-of-file-fixer
  63. - id: debug-statements
  64. - id: fix-encoding-pragma
  65. args: ["--remove"]
  66. - id: check-case-conflict
  67. - id: check-docstring-first
  68. - id: check-executables-have-shebangs
  69. - id: check-merge-conflict
  70. - id: check-symlinks
  71. - id: check-xml
  72. - id: mixed-line-ending
  73. args: ["--fix=lf"]
  74. - repo: https://gitlab.com/pycqa/flake8
  75. rev: 3.8.3
  76. hooks:
  77. - id: flake8
  78. name: flake8 except __init__.py
  79. exclude: /__init__\.py$
  80. additional_dependencies: ["flake8-bugbear==20.1.4"]
  81. - id: flake8
  82. name: flake8 only __init__.py
  83. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  84. files: /__init__\.py$
  85. additional_dependencies: ["flake8-bugbear==20.1.4"]
  86. - repo: https://github.com/pycqa/pylint
  87. rev: pylint-2.5.3
  88. hooks:
  89. - id: pylint
  90. name: pylint with optional checks
  91. args:
  92. - --valid_odoo_versions=14.0
  93. - --rcfile=.pylintrc
  94. - --exit-zero
  95. verbose: true
  96. additional_dependencies:
  97. - isort==4.3.4
  98. - pylint-odoo==3.5.0
  99. - id: pylint
  100. name: pylint with mandatory checks
  101. args:
  102. - --valid_odoo_versions=14.0
  103. - --rcfile=.pylintrc-mandatory
  104. additional_dependencies:
  105. - isort==4.3.4
  106. - pylint-odoo==3.5.0
  107. - repo: https://github.com/pre-commit/mirrors-eslint
  108. rev: v7.8.1
  109. hooks:
  110. - id: eslint
  111. verbose: true
  112. args:
  113. - --color
  114. - --fix