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.

110 lines
3.3 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. 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/pre-commit/mirrors-prettier
  27. rev: v2.1.2
  28. hooks:
  29. - id: prettier
  30. name: prettier + plugin-xml
  31. additional_dependencies:
  32. - "prettier@2.1.2"
  33. - "@prettier/plugin-xml@0.12.0"
  34. args:
  35. - --plugin=@prettier/plugin-xml
  36. - repo: https://github.com/pre-commit/mirrors-eslint
  37. rev: v7.8.1
  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$
  50. - id: end-of-file-fixer
  51. # exclude autogenerated files
  52. exclude: /README\.rst$
  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. - id: check-symlinks
  61. - id: check-xml
  62. - id: mixed-line-ending
  63. args: ["--fix=lf"]
  64. - repo: https://github.com/PyCQA/pylint
  65. rev: pylint-2.5.3
  66. hooks:
  67. - id: pylint
  68. name: pylint with optional checks
  69. args: ["--rcfile=.pylintrc", "--exit-zero"]
  70. verbose: true
  71. additional_dependencies: &pylint_deps
  72. - pylint-odoo==3.5.0
  73. - id: pylint
  74. name: pylint with mandatory checks
  75. args: ["--rcfile=.pylintrc-mandatory"]
  76. additional_dependencies: *pylint_deps
  77. - repo: https://github.com/asottile/pyupgrade
  78. rev: v1.26.2
  79. hooks:
  80. - id: pyupgrade
  81. - repo: https://github.com/acsone/setuptools-odoo
  82. rev: 2.6.0
  83. hooks:
  84. - id: setuptools-odoo-make-default
  85. - id: setuptools-odoo-get-requirements
  86. args:
  87. - --output
  88. - requirements.txt
  89. - --header
  90. - "# generated from manifests external_dependencies"
  91. - repo: https://gitlab.com/PyCQA/flake8
  92. rev: 3.8.3
  93. hooks:
  94. - id: flake8
  95. name: flake8 except __init__.py
  96. exclude: /__init__\.py$
  97. additional_dependencies: ["flake8-bugbear==20.1.4"]
  98. - id: flake8
  99. name: flake8 only __init__.py
  100. args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
  101. files: /__init__\.py$
  102. additional_dependencies: ["flake8-bugbear==20.1.4"]
  103. - repo: https://github.com/PyCQA/isort
  104. rev: 5.5.1
  105. hooks:
  106. - id: isort
  107. name: isort except __init__.py
  108. args:
  109. - --settings=.
  110. exclude: /__init__\.py$