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.

138 lines
4.2 KiB

2 years ago
2 years ago
2 years ago
  1. exclude: |
  2. (?x)
  3. # NOT INSTALLABLE ADDONS
  4. # END NOT INSTALLABLE ADDONS
  5. # Files and folders generated by bots, to avoid loops
  6. ^setup/|/static/description/index\.html$|
  7. # We don't want to mess with tool-generated files
  8. .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
  9. # Maybe reactivate this when all README files include prettier ignore tags?
  10. ^README\.md$|
  11. # Library files can have extraneous formatting (even minimized)
  12. /static/(src/)?lib/|
  13. # Repos using Sphinx to generate docs don't need prettying
  14. ^docs/_templates/.*\.html$|
  15. # You don't usually want a bot to modify your legal texts
  16. (LICENSE.*|COPYING.*)
  17. default_language_version:
  18. python: python3
  19. node: "14.13.0"
  20. repos:
  21. - repo: local
  22. hooks:
  23. # These files are most likely copier diff rejection junks; if found,
  24. # review them manually, fix the problem (if needed) and remove them
  25. - id: forbidden-files
  26. name: forbidden files
  27. entry: found forbidden files; remove them
  28. language: fail
  29. files: "\\.rej$"
  30. - id: en-po-files
  31. name: en.po files cannot exist
  32. entry: found a en.po file
  33. language: fail
  34. files: '[a-zA-Z0-9_]*/i18n/en\.po$'
  35. - repo: https://github.com/oca/maintainer-tools
  36. rev: ab1d7f6
  37. hooks:
  38. # update the NOT INSTALLABLE ADDONS section above
  39. - id: oca-update-pre-commit-excluded-addons
  40. - id: oca-fix-manifest-website
  41. args: ["https://github.com/OCA/partner-contact"]
  42. - repo: https://github.com/myint/autoflake
  43. rev: v1.4
  44. hooks:
  45. - id: autoflake
  46. args:
  47. - --expand-star-imports
  48. - --ignore-init-module-imports
  49. - --in-place
  50. - --remove-all-unused-imports
  51. - --remove-duplicate-keys
  52. - --remove-unused-variables
  53. - repo: https://github.com/psf/black
  54. rev: 22.3.0
  55. hooks:
  56. - id: black
  57. - repo: https://github.com/pre-commit/mirrors-prettier
  58. rev: v2.1.2
  59. hooks:
  60. - id: prettier
  61. name: prettier (with plugin-xml)
  62. additional_dependencies:
  63. - "prettier@2.1.2"
  64. - "@prettier/plugin-xml@0.12.0"
  65. args:
  66. - --plugin=@prettier/plugin-xml
  67. files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
  68. - repo: https://github.com/pre-commit/mirrors-eslint
  69. rev: v7.8.1
  70. hooks:
  71. - id: eslint
  72. verbose: true
  73. args:
  74. - --color
  75. - --fix
  76. - repo: https://github.com/pre-commit/pre-commit-hooks
  77. rev: v3.2.0
  78. hooks:
  79. - id: trailing-whitespace
  80. # exclude autogenerated files
  81. exclude: /README\.rst$|\.pot?$
  82. - id: end-of-file-fixer
  83. # exclude autogenerated files
  84. exclude: /README\.rst$|\.pot?$
  85. - id: debug-statements
  86. - id: fix-encoding-pragma
  87. args: ["--remove"]
  88. - id: check-case-conflict
  89. - id: check-docstring-first
  90. - id: check-executables-have-shebangs
  91. - id: check-merge-conflict
  92. # exclude files where underlines are not distinguishable from merge conflicts
  93. exclude: /README\.rst$|^docs/.*\.rst$
  94. - id: check-symlinks
  95. - id: check-xml
  96. - id: mixed-line-ending
  97. args: ["--fix=lf"]
  98. - repo: https://github.com/asottile/pyupgrade
  99. rev: v2.7.2
  100. hooks:
  101. - id: pyupgrade
  102. args: ["--keep-percent-format"]
  103. - repo: https://github.com/PyCQA/isort
  104. rev: 5.5.1
  105. hooks:
  106. - id: isort
  107. name: isort except __init__.py
  108. args:
  109. - --settings=.
  110. exclude: /__init__\.py$
  111. - repo: https://github.com/acsone/setuptools-odoo
  112. rev: 3.1.8
  113. hooks:
  114. - id: setuptools-odoo-make-default
  115. - id: setuptools-odoo-get-requirements
  116. args:
  117. - --output
  118. - requirements.txt
  119. - --header
  120. - "# generated from manifests external_dependencies"
  121. - repo: https://github.com/PyCQA/flake8
  122. rev: 3.8.3
  123. hooks:
  124. - id: flake8
  125. name: flake8
  126. additional_dependencies: ["flake8-bugbear==20.1.4"]
  127. - repo: https://github.com/OCA/pylint-odoo
  128. rev: 7.0.2
  129. hooks:
  130. - id: pylint_odoo
  131. name: pylint with optional checks
  132. args:
  133. - --rcfile=.pylintrc
  134. - --exit-zero
  135. verbose: true
  136. - id: pylint_odoo
  137. args:
  138. - --rcfile=.pylintrc-mandatory