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.

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