.pre-commit-config.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. # See https://pre-commit.com for more information
  18. # See https://pre-commit.com/hooks.html for more hooks
  19. default_stages: [commit, push]
  20. default_language_version:
  21. # force all python hooks to run python3
  22. python: python3
  23. repos:
  24. # Python API Hooks
  25. - repo: https://github.com/pycqa/isort
  26. rev: 5.10.1
  27. hooks:
  28. - id: isort
  29. name: isort (python)
  30. - repo: https://github.com/psf/black
  31. rev: 22.3.0
  32. hooks:
  33. - id: black
  34. - repo: https://github.com/pycqa/flake8
  35. rev: 4.0.1
  36. hooks:
  37. - id: flake8
  38. additional_dependencies: [
  39. 'flake8-docstrings>=1.6',
  40. 'flake8-black>=0.2',
  41. ]
  42. - repo: https://github.com/pycqa/autoflake
  43. rev: v1.4
  44. hooks:
  45. - id: autoflake
  46. args: [
  47. --remove-all-unused-imports,
  48. --ignore-init-module-imports,
  49. --in-place
  50. ]
  51. - repo: local
  52. hooks:
  53. # Spotless Hooks
  54. - id: spotless
  55. name: spotless lint
  56. entry: ./mvnw spotless:check
  57. language: script
  58. pass_filenames: false