Skip to content

Commit

Permalink
run isort before black (#2258)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhizor authored Mar 2, 2021
1 parent 26e1651 commit fc94ccd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions buildSrc/src/main/groovy/airbyte-python.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ class AirbytePythonPlugin implements Plugin<Project> {
pip 'pip:20.2'
}

project.task('isortFormat', type: PythonTask) {
module = "isort"
command = ". --settings-file ${project.rootProject.file('tools/python/.isort.cfg').absolutePath}"
}

project.task('blackFormat', type: PythonTask) {
module = "black"
// the line length should match .isort.cfg
command = ". --line-length 140"
dependsOn project.rootProject.spotlessPythonApply
}

project.task('isortFormat', type: PythonTask) {
module = "isort"
command = ". --settings-file ${project.rootProject.file('tools/python/.isort.cfg').absolutePath}"
dependsOn project.isortFormat
}

project.task('flakeCheck', type: PythonTask, dependsOn: project.blackFormat) {
Expand Down

0 comments on commit fc94ccd

Please sign in to comment.