.pre-commit-config.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. - repo: https://github.com/pycqa/isort
  25. rev: 5.10.1
  26. hooks:
  27. - id: isort
  28. name: isort (python)
  29. - repo: https://github.com/psf/black
  30. rev: 22.1.0
  31. hooks:
  32. - id: black
  33. - repo: https://github.com/pycqa/flake8
  34. rev: 4.0.1
  35. hooks:
  36. - id: flake8
  37. additional_dependencies: [
  38. 'flake8-docstrings>=1.6',
  39. 'flake8-black>=0.2',
  40. ]
  41. # pre-commit run in the root, so we have to point out the full path of configuration
  42. args: [
  43. --config,
  44. dolphinscheduler-python/pydolphinscheduler/.flake8
  45. ]
  46. - repo: https://github.com/pycqa/autoflake
  47. rev: v1.4
  48. hooks:
  49. - id: autoflake
  50. args: [
  51. --remove-all-unused-imports,
  52. --ignore-init-module-imports,
  53. --in-place
  54. ]