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.

124 lines
3.8 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. # Maybe reactivate this when all README files include prettier ignore tags?
  8. ^README\.md$|
  9. # Library files can have extraneous formatting (even minimized)
  10. /static/(src/)?lib/|
  11. # Repos using Sphinx to generate docs don't need prettying
  12. ^docs/_templates/.*\.html$|
  13. # You don't usually want a bot to modify your legal texts
  14. (LICENSE.*|COPYING.*)
  15. default_language_version:
  16. python: python3
  17. node: "14.13.0"
  18. repos:
  19. - repo: local
  20. hooks:
  21. # These files are most likely copier diff rejection junks; if found,
  22. # review them manually, fix the problem (if needed) and remove them
  23. - id: forbidden-files
  24. name: forbidden files
  25. entry: found forbidden files; remove them
  26. language: fail
  27. files: "\\.rej$"
  28. - repo: https://github.com/oca/maintainer-tools
  29. rev: 2c66e72
  30. hooks:
  31. # update the NOT INSTALLABLE ADDONS section above
  32. - id: oca-update-pre-commit-excluded-addons
  33. - repo: https://github.com/myint/autoflake
  34. rev: v1.4
  35. hooks:
  36. - id: autoflake
  37. args: ["-i", "--ignore-init-module-imports"]
  38. - repo: https://github.com/psf/black
  39. rev: 20.8b1
  40. hooks:
  41. - id: black
  42. - repo: https://github.com/prettier/prettier
  43. rev: 2.1.2
  44. hooks:
  45. - id: prettier
  46. name: prettier + plugin-xml
  47. additional_dependencies:
  48. - "@prettier/plugin-xml@0.12.0"
  49. args:
  50. - --plugin=@prettier/plugin-xml
  51. - repo: https://github.com/pre-commit/mirrors-eslint
  52. rev: v7.8.1
  53. hooks:
  54. - id: eslint
  55. verbose: true
  56. args:
  57. - --color
  58. - --fix
  59. - repo: https://github.com/pre-commit/pre-commit-hooks
  60. rev: v3.2.0
  61. hooks:
  62. - id: trailing-whitespace
  63. # exclude autogenerated files
  64. exclude: /README\.rst$|\.pot?$
  65. - id: end-of-file-fixer
  66. # exclude autogenerated files
  67. exclude: /README\.rst$|\.pot?$
  68. - id: debug-statements
  69. - id: fix-encoding-pragma
  70. args: ["--remove"]
  71. - id: check-case-conflict
  72. - id: check-docstring-first
  73. - id: check-executables-have-shebangs
  74. - id: check-merge-conflict
  75. # exclude files where underlines are not distinguishable from merge conflicts
  76. exclude: /README\.rst$|^docs/.*\.rst$
  77. - id: check-symlinks
  78. - id: check-xml
  79. - id: mixed-line-ending
  80. args: ["--fix=lf"]
  81. - repo: https://github.com/asottile/pyupgrade
  82. rev: v2.7.2
  83. hooks:
  84. - id: pyupgrade
  85. - repo: https://github.com/PyCQA/isort
  86. rev: 5.5.1
  87. hooks:
  88. - id: isort
  89. name: isort except __init__.py
  90. args:
  91. - --settings=.
  92. exclude: /__init__\.py$
  93. - repo: https://github.com/acsone/setuptools-odoo
  94. rev: 2.5.10
  95. hooks:
  96. - id: setuptools-odoo-make-default
  97. - repo: https://gitlab.com/PyCQA/flake8
  98. rev: 3.8.3
  99. hooks:
  100. - id: flake8
  101. name: flake8 except __init__.py
  102. exclude: /__init__\.py$
  103. additional_dependencies: ["flake8-bugbear==20.1.4"]
  104. - id: flake8
  105. name: flake8 only __init__.py
  106. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  107. files: /__init__\.py$
  108. additional_dependencies: ["flake8-bugbear==20.1.4"]
  109. - repo: https://github.com/PyCQA/pylint
  110. rev: pylint-2.5.3
  111. hooks:
  112. - id: pylint
  113. name: pylint with optional checks
  114. args:
  115. - --rcfile=.pylintrc
  116. - --exit-zero
  117. verbose: true
  118. additional_dependencies: &pylint_deps
  119. - pylint-odoo==3.5.0
  120. - id: pylint
  121. name: pylint with mandatory checks
  122. args:
  123. - --rcfile=.pylintrc-mandatory
  124. additional_dependencies: *pylint_deps