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.

99 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: flake8
  54. name: flake8 except __init__.py
  55. exclude: /__init__\.py$
  56. additional_dependencies: ["flake8-bugbear==19.8.0"]
  57. - id: flake8
  58. name: flake8 only __init__.py
  59. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  60. files: /__init__\.py$
  61. additional_dependencies: ["flake8-bugbear==19.8.0"]
  62. - id: fix-encoding-pragma
  63. args: ["--remove"]
  64. - id: check-case-conflict
  65. - id: check-docstring-first
  66. - id: check-executables-have-shebangs
  67. - id: check-merge-conflict
  68. # exclude files where underlines are not distinguishable from merge conflicts
  69. exclude: /README\.rst$|^docs/.*\.rst$
  70. - id: check-symlinks
  71. - id: check-xml
  72. - id: mixed-line-ending
  73. args: ["--fix=lf"]
  74. - repo: https://github.com/pre-commit/mirrors-pylint
  75. rev: v2.3.1
  76. hooks:
  77. - id: pylint
  78. name: pylint with optional checks
  79. args: ["--rcfile=.pylintrc", "--exit-zero"]
  80. verbose: true
  81. additional_dependencies: ["pylint-odoo==3.1.0"]
  82. - id: pylint
  83. name: pylint with mandatory checks
  84. args: ["--rcfile=.pylintrc-mandatory"]
  85. additional_dependencies: ["pylint-odoo==3.1.0"]
  86. - repo: https://github.com/asottile/pyupgrade
  87. rev: v1.26.2
  88. hooks:
  89. - id: pyupgrade
  90. - repo: https://github.com/pre-commit/mirrors-isort
  91. rev: v4.3.21
  92. hooks:
  93. - id: isort
  94. name: isort except __init__.py
  95. exclude: /__init__\.py$
  96. - repo: https://github.com/acsone/setuptools-odoo
  97. rev: 2.5.2
  98. hooks:
  99. - id: setuptools-odoo-make-default