|
21 | 21 |
|
22 | 22 | [![GitHub Build][ga-py-test]][ga] |
23 | 23 | [![Code style: black][black-shield]][black-gh] |
| 24 | +[![Imports: isort][isort-shield]][isort-gh] |
24 | 25 |
|
25 | 26 | pydolphinscheduler is python API for Apache DolphinScheduler, which allow you definition |
26 | 27 | your workflow by python code, aka workflow-as-codes. |
@@ -104,16 +105,20 @@ and would be implemented in the further. |
104 | 105 |
|
105 | 106 | ### Code Style |
106 | 107 |
|
107 | | -We use [Black][black] for code formatter and [Flake8][flake8] for pep8 checker. If you use [pycharm][pycharm] |
108 | | -or [IntelliJ IDEA][idea], maybe you could follow [Black-integration][black-editor] to configure them in your environment. |
| 108 | +We use [isort][isort] to automatically keep Python imports alphabetically, and use [Black][black] for code |
| 109 | +formatter and [Flake8][flake8] for pep8 checker. If you use [pycharm][pycharm]or [IntelliJ IDEA][idea], |
| 110 | +maybe you could follow [Black-integration][black-editor] to configure them in your environment. |
109 | 111 |
|
110 | | -Our Python API CI would automatically run unittest when you submit pull request in GitHub, you could also run |
111 | | -static check locally. |
| 112 | +Our Python API CI would automatically run code style checker and unittest when you submit pull request in |
| 113 | +GitHub, you could also run static check locally. |
112 | 114 |
|
113 | 115 | ```shell |
114 | | -# We recommend you run Black before Flake8, because Black could auto fix some code style issue |
| 116 | +# We recommend you run isort and Black before Flake8, because Black could auto fix some code style issue |
115 | 117 | # but Flake8 just hint when code style not match pep8 |
116 | 118 |
|
| 119 | +# Run Isort |
| 120 | +isort . |
| 121 | + |
117 | 122 | # Run Black |
118 | 123 | black . |
119 | 124 |
|
@@ -158,8 +163,11 @@ this command output. |
158 | 163 | [flake8]: https://flake8.pycqa.org/en/latest/index.html |
159 | 164 | [black-editor]: https://black.readthedocs.io/en/stable/integrations/editors.html#pycharm-intellij-idea |
160 | 165 | [coverage]: https://coverage.readthedocs.io/en/stable/ |
| 166 | +[isort]: https://pycqa.github.io/isort/index.html |
161 | 167 | <!-- badge --> |
162 | 168 | [ga-py-test]: https://github.com/apache/dolphinscheduler/actions/workflows/py-ci.yml/badge.svg?branch=dev |
163 | 169 | [ga]: https://github.com/apache/dolphinscheduler/actions |
164 | 170 | [black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg |
165 | 171 | [black-gh]: https://github.com/psf/black |
| 172 | +[isort-shield]: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336 |
| 173 | +[isort-gh]: https://pycqa.github.io/isort/ |
0 commit comments