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.

107 lines
3.4 KiB

  1. exclude: |
  2. (?x)
  3. # Files and folders generated by bots, to avoid loops
  4. ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$|
  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/myint/autoflake
  17. rev: v1.4
  18. hooks:
  19. - id: autoflake
  20. args: ["-i", "--ignore-init-module-imports"]
  21. - repo: https://github.com/psf/black
  22. rev: 19.10b0
  23. hooks:
  24. - id: black
  25. - repo: https://github.com/prettier/prettier
  26. rev: "1.19.1"
  27. hooks:
  28. - id: prettier
  29. # TODO Avoid awebdeveloper/pre-commit-prettier if possible
  30. # HACK https://github.com/prettier/prettier/issues/7407
  31. - repo: https://github.com/awebdeveloper/pre-commit-prettier
  32. rev: v0.0.1
  33. hooks:
  34. - id: prettier
  35. name: prettier xml plugin
  36. additional_dependencies:
  37. - "prettier@1.19.1"
  38. - "@prettier/plugin-xml@0.7.2"
  39. files: \.xml$
  40. - repo: https://github.com/pre-commit/mirrors-eslint
  41. rev: v6.8.0
  42. hooks:
  43. - id: eslint
  44. verbose: true
  45. args:
  46. - --color
  47. - --fix
  48. - repo: https://github.com/pre-commit/pre-commit-hooks
  49. rev: v2.4.0
  50. hooks:
  51. - id: trailing-whitespace
  52. # exclude autogenerated files
  53. exclude: /README\.rst$|\.pot?$
  54. - id: end-of-file-fixer
  55. # exclude autogenerated files
  56. exclude: /README\.rst$|\.pot?$
  57. - id: debug-statements
  58. - id: fix-encoding-pragma
  59. args: ["--remove"]
  60. - id: check-case-conflict
  61. - id: check-docstring-first
  62. - id: check-executables-have-shebangs
  63. - id: check-merge-conflict
  64. # exclude files where underlines are not distinguishable from merge conflicts
  65. exclude: /README\.rst$|^docs/.*\.rst$
  66. - id: check-symlinks
  67. - id: check-xml
  68. - id: mixed-line-ending
  69. args: ["--fix=lf"]
  70. - repo: https://gitlab.com/pycqa/flake8
  71. rev: 3.7.9
  72. hooks:
  73. - id: flake8
  74. name: flake8 except __init__.py
  75. exclude: /__init__\.py$
  76. additional_dependencies: ["flake8-bugbear==19.8.0"]
  77. - id: flake8
  78. name: flake8 only __init__.py
  79. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  80. files: /__init__\.py$
  81. additional_dependencies: ["flake8-bugbear==19.8.0"]
  82. - repo: https://github.com/pre-commit/mirrors-pylint
  83. rev: v2.3.1
  84. hooks:
  85. - id: pylint
  86. name: pylint with optional checks
  87. args: ["--rcfile=.pylintrc", "--exit-zero"]
  88. verbose: true
  89. additional_dependencies: ["pylint-odoo==3.1.0"]
  90. - id: pylint
  91. name: pylint with mandatory checks
  92. args: ["--rcfile=.pylintrc-mandatory"]
  93. additional_dependencies: ["pylint-odoo==3.1.0"]
  94. - repo: https://github.com/asottile/pyupgrade
  95. rev: v1.26.2
  96. hooks:
  97. - id: pyupgrade
  98. - repo: https://github.com/pre-commit/mirrors-isort
  99. rev: v4.3.21
  100. hooks:
  101. - id: isort
  102. name: isort except __init__.py
  103. exclude: /__init__\.py$
  104. - repo: https://github.com/acsone/setuptools-odoo
  105. rev: 2.5.10
  106. hooks:
  107. - id: setuptools-odoo-make-default