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.

109 lines
3.4 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/humitos/mirrors-autoflake
  17. rev: v1.3
  18. hooks:
  19. - id: autoflake
  20. args:
  21. [
  22. "--exclude",
  23. "__init__.py",
  24. "--in-place",
  25. "--remove-all-unused-imports",
  26. "--remove-unused-variable",
  27. ]
  28. - repo: https://github.com/psf/black
  29. rev: 19.10b0
  30. hooks:
  31. - id: black
  32. - repo: https://github.com/prettier/prettier
  33. rev: "1.19.1"
  34. hooks:
  35. - id: prettier
  36. # TODO Avoid awebdeveloper/pre-commit-prettier if possible
  37. # HACK https://github.com/prettier/prettier/issues/7407
  38. - repo: https://github.com/awebdeveloper/pre-commit-prettier
  39. rev: v0.0.1
  40. hooks:
  41. - id: prettier
  42. name: prettier xml plugin
  43. additional_dependencies:
  44. - "prettier@1.19.1"
  45. - "@prettier/plugin-xml@0.5.0"
  46. files: \.xml$
  47. - repo: https://github.com/pre-commit/mirrors-eslint
  48. rev: v6.8.0
  49. hooks:
  50. - id: eslint
  51. verbose: true
  52. args:
  53. - --color
  54. - --fix
  55. - repo: https://github.com/pre-commit/pre-commit-hooks
  56. rev: v2.4.0
  57. hooks:
  58. - id: trailing-whitespace
  59. # exclude autogenerated files
  60. exclude: /README\.rst$|\.pot?$
  61. - id: end-of-file-fixer
  62. # exclude autogenerated files
  63. exclude: /README\.rst$|\.pot?$
  64. - id: debug-statements
  65. - id: flake8
  66. name: flake8 except __init__.py
  67. exclude: /__init__\.py$
  68. args: ["--extend-ignore=B301,F821"] # B301,F821 are python3 only
  69. additional_dependencies: ["flake8-bugbear==19.8.0"]
  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==19.8.0"]
  75. - id: fix-encoding-pragma
  76. - id: check-case-conflict
  77. - id: check-docstring-first
  78. - id: check-executables-have-shebangs
  79. - id: check-merge-conflict
  80. - id: check-symlinks
  81. - id: check-xml
  82. - id: mixed-line-ending
  83. args: ["--fix=lf"]
  84. - repo: https://github.com/pre-commit/mirrors-pylint
  85. rev: v2.3.1
  86. hooks:
  87. - id: pylint
  88. name: pylint with optional checks
  89. args: ["--rcfile=.pylintrc", "--exit-zero"]
  90. verbose: true
  91. additional_dependencies: ["pylint-odoo==3.0.3"]
  92. - id: pylint
  93. name: pylint with mandatory checks
  94. args: ["--rcfile=.pylintrc-mandatory"]
  95. additional_dependencies: ["pylint-odoo==3.0.3"]
  96. - repo: https://github.com/asottile/pyupgrade
  97. rev: v1.26.2
  98. hooks:
  99. - id: pyupgrade
  100. - repo: https://github.com/asottile/seed-isort-config
  101. rev: v1.9.4
  102. hooks:
  103. - id: seed-isort-config
  104. - repo: https://github.com/pre-commit/mirrors-isort
  105. rev: v4.3.21
  106. hooks:
  107. - id: isort
  108. name: isort except __init__.py
  109. exclude: /__init__\.py$