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.

135 lines
4.2 KiB

  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$|
  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. - repo: https://github.com/oca/maintainer-tools
  31. rev: ab1d7f6
  32. hooks:
  33. # update the NOT INSTALLABLE ADDONS section above
  34. - id: oca-update-pre-commit-excluded-addons
  35. - id: oca-fix-manifest-website
  36. args: ["https://github.com/OCA/partner-contact"]
  37. - repo: https://github.com/myint/autoflake
  38. rev: v1.4
  39. hooks:
  40. - id: autoflake
  41. args: ["-i", "--ignore-init-module-imports"]
  42. - repo: https://github.com/psf/black
  43. rev: 20.8b1
  44. hooks:
  45. - id: black
  46. - repo: https://github.com/pre-commit/mirrors-prettier
  47. rev: v2.1.2
  48. hooks:
  49. - id: prettier
  50. name: prettier + plugin-xml
  51. additional_dependencies:
  52. - "prettier@2.1.2"
  53. - "@prettier/plugin-xml@0.12.0"
  54. args:
  55. - --plugin=@prettier/plugin-xml
  56. - repo: https://github.com/pre-commit/mirrors-eslint
  57. rev: v7.8.1
  58. hooks:
  59. - id: eslint
  60. verbose: true
  61. args:
  62. - --color
  63. - --fix
  64. - repo: https://github.com/pre-commit/pre-commit-hooks
  65. rev: v3.2.0
  66. hooks:
  67. - id: trailing-whitespace
  68. # exclude autogenerated files
  69. exclude: /README\.rst$|\.pot?$
  70. - id: end-of-file-fixer
  71. # exclude autogenerated files
  72. exclude: /README\.rst$|\.pot?$
  73. - id: debug-statements
  74. - id: fix-encoding-pragma
  75. args: ["--remove"]
  76. - id: check-case-conflict
  77. - id: check-docstring-first
  78. - id: check-executables-have-shebangs
  79. - id: check-merge-conflict
  80. # exclude files where underlines are not distinguishable from merge conflicts
  81. exclude: /README\.rst$|^docs/.*\.rst$
  82. - id: check-symlinks
  83. - id: check-xml
  84. - id: mixed-line-ending
  85. args: ["--fix=lf"]
  86. - repo: https://github.com/asottile/pyupgrade
  87. rev: v2.7.2
  88. hooks:
  89. - id: pyupgrade
  90. - repo: https://github.com/PyCQA/isort
  91. rev: 5.5.1
  92. hooks:
  93. - id: isort
  94. name: isort except __init__.py
  95. args:
  96. - --settings=.
  97. exclude: /__init__\.py$
  98. - repo: https://github.com/acsone/setuptools-odoo
  99. rev: 2.6.0
  100. hooks:
  101. - id: setuptools-odoo-make-default
  102. - id: setuptools-odoo-get-requirements
  103. args:
  104. - --output
  105. - requirements.txt
  106. - --header
  107. - "# generated from manifests external_dependencies"
  108. - repo: https://gitlab.com/PyCQA/flake8
  109. rev: 3.8.3
  110. hooks:
  111. - id: flake8
  112. name: flake8 except __init__.py
  113. exclude: /__init__\.py$
  114. additional_dependencies: ["flake8-bugbear==20.1.4"]
  115. - id: flake8
  116. name: flake8 only __init__.py
  117. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  118. files: /__init__\.py$
  119. additional_dependencies: ["flake8-bugbear==20.1.4"]
  120. - repo: https://github.com/PyCQA/pylint
  121. rev: pylint-2.5.3
  122. hooks:
  123. - id: pylint
  124. name: pylint with optional checks
  125. args:
  126. - --rcfile=.pylintrc
  127. - --exit-zero
  128. verbose: true
  129. additional_dependencies: &pylint_deps
  130. - pylint-odoo==3.5.0
  131. - id: pylint
  132. name: pylint with mandatory checks
  133. args:
  134. - --rcfile=.pylintrc-mandatory
  135. additional_dependencies: *pylint_deps