diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75ee7fc1..735559b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,10 @@ jobs: distribution: temurin java-version: 18 + - name: Set up black (Python) + shell: bash + run: pip install black==23.3.0 + - name: Run unit tests uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0 with: diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt index 4b712908..a9025602 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt @@ -35,6 +35,10 @@ class SpotlessPlugin : Plugin { targetExclude("**/build/") licenseHeaderFile(project.file("spotless/license.kt"), "import|plugins|@file") } + python { + target("scripts/**.py") + black("23.3.0") + } format("xml") { target("**/*.xml") targetExclude("**/build/", ".idea/", "/spotless/", "**/lint-baseline.xml") diff --git a/scripts/deploy-snapshot.py b/scripts/deploy-snapshot.py index fd2a495f..bd58f499 100755 --- a/scripts/deploy-snapshot.py +++ b/scripts/deploy-snapshot.py @@ -14,10 +14,20 @@ def exec(command_str: str, shell: bool = False) -> Optional[int]: print(f"Executing '{command_str}'") proc = None if shell: - proc = subprocess.run(command_str, text=True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + proc = subprocess.run( + command_str, + text=True, + shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) else: proc = subprocess.run( - command_str.split(" "), text=True, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + command_str.split(" "), + text=True, + shell=False, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, ) result = proc.returncode print(f"{proc.stdout}") @@ -72,9 +82,9 @@ def create_release(): apks = " ".join(glob.glob("*.apk")) exec( "gh release create --prerelease " - +f"--title 'Latest snapshot build' --notes-file {cf.name} " - +f"{NIGHTLY_TAG} {apks}", - shell=True + + f"--title 'Latest snapshot build' --notes-file {cf.name} " + + f"{NIGHTLY_TAG} {apks}", + shell=True, ) os.chdir(cwd)