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.

102 lines
3.2 KiB

  1. exclude: |
  2. (?x)
  3. # Files and folders generated by bots, to avoid loops
  4. ^setup/|/static/description/index\.html$|
  5. # Maybe reactivate this when all README files include prettier ignore tags?
  6. ^README\.md$|
  7. # Library files can have extraneous formatting (even minimized)
  8. /static/(src/)?lib/|
  9. # Repos using Sphinx to generate docs don't need prettying
  10. ^docs/_templates/.*\.html$|
  11. # You don't usually want a bot to modify your legal texts
  12. (LICENSE.*|COPYING.*)
  13. default_language_version:
  14. python: python3
  15. repos:
  16. - repo: https://github.com/psf/black
  17. rev: 19.10b0
  18. hooks:
  19. - id: black
  20. - repo: https://github.com/prettier/prettier
  21. rev: "1.19.1"
  22. hooks:
  23. - id: prettier
  24. # TODO Avoid awebdeveloper/pre-commit-prettier if possible
  25. # HACK https://github.com/prettier/prettier/issues/7407
  26. - repo: https://github.com/awebdeveloper/pre-commit-prettier
  27. rev: v0.0.1
  28. hooks:
  29. - id: prettier
  30. name: prettier xml plugin
  31. additional_dependencies:
  32. - "prettier@1.19.1"
  33. - "@prettier/plugin-xml@0.7.2"
  34. files: \.xml$
  35. - repo: https://github.com/pre-commit/mirrors-eslint
  36. rev: v6.8.0
  37. hooks:
  38. - id: eslint
  39. verbose: true
  40. args:
  41. - --color
  42. - --fix
  43. - repo: https://github.com/pre-commit/pre-commit-hooks
  44. rev: v2.4.0
  45. hooks:
  46. - id: trailing-whitespace
  47. # exclude autogenerated files
  48. exclude: /README\.rst$|\.pot?$
  49. - id: end-of-file-fixer
  50. # exclude autogenerated files
  51. exclude: /README\.rst$|\.pot?$
  52. - id: debug-statements
  53. - id: fix-encoding-pragma
  54. args: ["--remove"]
  55. - id: check-case-conflict
  56. - id: check-docstring-first
  57. - id: check-executables-have-shebangs
  58. - id: check-merge-conflict
  59. # exclude files where underlines are not distinguishable from merge conflicts
  60. exclude: /README\.rst$|^docs/.*\.rst$
  61. - id: check-symlinks
  62. - id: check-xml
  63. - id: mixed-line-ending
  64. args: ["--fix=lf"]
  65. - repo: https://gitlab.com/pycqa/flake8
  66. rev: 3.7.9
  67. hooks:
  68. - id: flake8
  69. name: flake8 except __init__.py
  70. exclude: /__init__\.py$
  71. additional_dependencies: ["flake8-bugbear==19.8.0"]
  72. - id: flake8
  73. name: flake8 only __init__.py
  74. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  75. files: /__init__\.py$
  76. additional_dependencies: ["flake8-bugbear==19.8.0"]
  77. - repo: https://github.com/pre-commit/mirrors-pylint
  78. rev: v2.3.1
  79. hooks:
  80. - id: pylint
  81. name: pylint with optional checks
  82. args: ["--rcfile=.pylintrc", "--exit-zero"]
  83. verbose: true
  84. additional_dependencies: ["pylint-odoo==3.1.0"]
  85. - id: pylint
  86. name: pylint with mandatory checks
  87. args: ["--rcfile=.pylintrc-mandatory"]
  88. additional_dependencies: ["pylint-odoo==3.1.0"]
  89. - repo: https://github.com/asottile/pyupgrade
  90. rev: v1.26.2
  91. hooks:
  92. - id: pyupgrade
  93. - repo: https://github.com/pre-commit/mirrors-isort
  94. rev: v4.3.21
  95. hooks:
  96. - id: isort
  97. name: isort except __init__.py
  98. exclude: /__init__\.py$
  99. - repo: https://github.com/acsone/setuptools-odoo
  100. rev: 2.5.2
  101. hooks:
  102. - id: setuptools-odoo-make-default