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.

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