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.

108 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. node: "14.13.0"
  16. repos:
  17. - repo: https://github.com/myint/autoflake
  18. rev: v1.4
  19. hooks:
  20. - id: autoflake
  21. args: ["-i", "--ignore-init-module-imports"]
  22. - repo: https://github.com/psf/black
  23. rev: 20.8b1
  24. hooks:
  25. - id: black
  26. - repo: https://github.com/prettier/prettier
  27. rev: 2.1.2
  28. hooks:
  29. - id: prettier
  30. name: prettier + plugin-xml
  31. additional_dependencies:
  32. - "@prettier/plugin-xml@0.12.0"
  33. args:
  34. - --plugin=@prettier/plugin-xml
  35. - repo: https://github.com/pre-commit/mirrors-eslint
  36. rev: v7.8.1
  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: v3.2.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://github.com/asottile/pyupgrade
  66. rev: v2.7.2
  67. hooks:
  68. - id: pyupgrade
  69. - repo: https://github.com/PyCQA/isort
  70. rev: 5.5.1
  71. hooks:
  72. - id: isort
  73. name: isort except __init__.py
  74. args:
  75. - --settings=.
  76. exclude: /__init__\.py$
  77. - repo: https://github.com/acsone/setuptools-odoo
  78. rev: 2.5.10
  79. hooks:
  80. - id: setuptools-odoo-make-default
  81. - repo: https://gitlab.com/PyCQA/flake8
  82. rev: 3.8.3
  83. hooks:
  84. - id: flake8
  85. name: flake8 except __init__.py
  86. exclude: /__init__\.py$
  87. additional_dependencies: ["flake8-bugbear==20.1.4"]
  88. - id: flake8
  89. name: flake8 only __init__.py
  90. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  91. files: /__init__\.py$
  92. additional_dependencies: ["flake8-bugbear==20.1.4"]
  93. - repo: https://github.com/PyCQA/pylint
  94. rev: pylint-2.5.3
  95. hooks:
  96. - id: pylint
  97. name: pylint with optional checks
  98. args:
  99. - --rcfile=.pylintrc
  100. - --exit-zero
  101. verbose: true
  102. additional_dependencies: &pylint_deps
  103. - pylint-odoo==3.5.0
  104. - id: pylint
  105. name: pylint with mandatory checks
  106. args:
  107. - --rcfile=.pylintrc-mandatory
  108. additional_dependencies: *pylint_deps