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.

103 lines
3.0 KiB

  1. exclude: |
  2. (?x)
  3. # Files and folders generated by bots, to avoid loops
  4. /static/description/index\.html$|
  5. # Library files can have extraneous formatting (even minimized)
  6. /static/(src/)?lib/|
  7. # You don't usually want a bot to modify your legal texts
  8. (LICENSE.*|COPYING.*)
  9. default_language_version:
  10. python: python3
  11. node: "14.14.0"
  12. repos:
  13. - repo: local
  14. hooks:
  15. - id: forbidden-files
  16. name: forbidden files
  17. entry: found forbidden files; remove them
  18. language: fail
  19. files: "\\.rej$"
  20. - repo: https://github.com/psf/black
  21. rev: 20.8b1
  22. hooks:
  23. - id: black
  24. - repo: https://github.com/asottile/pyupgrade
  25. rev: v2.7.2
  26. hooks:
  27. - id: pyupgrade
  28. - repo: https://github.com/timothycrosley/isort
  29. rev: 5.5.1
  30. hooks:
  31. - id: isort
  32. name: isort except __init__.py
  33. args: [--settings, .]
  34. exclude: /__init__\.py$
  35. # TODO Migrate to new prettier pre-commit repo after fixed:
  36. # HACK https://github.com/prettier/pre-commit/pull/17
  37. # HACK https://github.com/prettier/pre-commit/pull/18
  38. - repo: https://github.com/prettier/prettier
  39. rev: 2.1.2
  40. hooks:
  41. - id: prettier
  42. name: prettier + plugin-xml
  43. additional_dependencies:
  44. - "@prettier/plugin-xml@0.12.0"
  45. args:
  46. - --plugin=@prettier/plugin-xml
  47. - repo: https://github.com/pre-commit/pre-commit-hooks
  48. rev: v3.2.0
  49. hooks:
  50. - id: trailing-whitespace
  51. - id: end-of-file-fixer
  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. - id: check-symlinks
  60. - id: check-xml
  61. - id: mixed-line-ending
  62. args: ["--fix=lf"]
  63. - repo: https://gitlab.com/pycqa/flake8
  64. rev: 3.8.3
  65. hooks:
  66. - id: flake8
  67. name: flake8 except __init__.py
  68. exclude: /__init__\.py$
  69. additional_dependencies: ["flake8-bugbear==20.1.4"]
  70. - id: flake8
  71. name: flake8 only __init__.py
  72. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  73. files: /__init__\.py$
  74. additional_dependencies: ["flake8-bugbear==20.1.4"]
  75. - repo: https://github.com/pycqa/pylint
  76. rev: pylint-2.6.0
  77. hooks:
  78. - id: pylint
  79. name: pylint with optional checks
  80. args:
  81. - --valid_odoo_versions=14.0
  82. - --rcfile=.pylintrc
  83. - --exit-zero
  84. verbose: true
  85. additional_dependencies:
  86. - isort==4.3.21
  87. - pylint-odoo==3.5.0
  88. - id: pylint
  89. name: pylint with mandatory checks
  90. args:
  91. - --valid_odoo_versions=14.0
  92. - --rcfile=.pylintrc-mandatory
  93. additional_dependencies:
  94. - isort==4.3.21
  95. - pylint-odoo==3.5.0
  96. - repo: https://github.com/pre-commit/mirrors-eslint
  97. rev: v7.8.1
  98. hooks:
  99. - id: eslint
  100. verbose: true
  101. args:
  102. - --color
  103. - --fix