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