From 33b8c0e2030f05d48a845d2f1f31caf9c35802f1 Mon Sep 17 00:00:00 2001 From: Alex Morgan Date: Mon, 30 Mar 2026 11:39:58 -0400 Subject: [PATCH 1/5] ci: use newer husky version --- .husky/_/husky.sh | 34 ++++++---------------------------- .husky/commit-msg | 5 +---- .husky/pre-commit | 10 ++++++---- 3 files changed, 13 insertions(+), 36 deletions(-) diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh index 6809ccc..f9d0637 100644 --- a/.husky/_/husky.sh +++ b/.husky/_/husky.sh @@ -1,31 +1,9 @@ -#!/bin/sh -if [ -z "$husky_skip_init" ]; then - debug () { - if [ "$HUSKY_DEBUG" = "1" ]; then - echo "husky (debug) - $1" - fi - } +echo "husky - DEPRECATED - readonly hook_name="$(basename "$0")" - debug "starting $hook_name..." +Please remove the following two lines from $0: - if [ "$HUSKY" = "0" ]; then - debug "HUSKY env variable is set to 0, skipping hook" - exit 0 - fi +#!/usr/bin/env sh +. \"\$(dirname -- \"\$0\")/_/husky.sh\" - if [ -f ~/.huskyrc ]; then - debug "sourcing ~/.huskyrc" - . ~/.huskyrc - fi - - export readonly husky_skip_init=1 - sh -e "$0" "$@" - exitCode="$?" - - if [ $exitCode != 0 ]; then - echo "husky - $hook_name hook exited with code $exitCode (error)" - fi - - exit $exitCode -fi +They WILL FAIL in v10.0.0 +" \ No newline at end of file diff --git a/.husky/commit-msg b/.husky/commit-msg index 617efbd..813b76e 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx --no-install commitlint --edit +npx --no-install commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit index 89d73a2..a8bf112 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,6 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -ktlint "**/src/**/*.kt" "!**/generated/**" --android --reporter=plain?group_by_file \ No newline at end of file +if which ktlint; then + ktlint "**/src/**/*.kt" "!**/generated/**" --android --reporter=plain?group_by_file +else + echo "ERROR: Please install ktlint to contribute to this project: brew install ktlint" + exit 1 +fi From 1e14e96e7aca5ff7e731bcd9944de119ec186b13 Mon Sep 17 00:00:00 2001 From: Alex Morgan Date: Mon, 30 Mar 2026 11:40:44 -0400 Subject: [PATCH 2/5] ci: use addlicense in the pre-commit hook --- .husky/pre-commit | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index a8bf112..6b78d6d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -4,3 +4,10 @@ else echo "ERROR: Please install ktlint to contribute to this project: brew install ktlint" exit 1 fi + +if which addlicense; then + addlicense -f LICENSE $(find . -path "*/src/*" \( -name "*.java" -o -name "*.kt" -o -name "*.kts" \) -type f) +else + echo "ERROR: Please install addlicense to contribute to this project: brew install addlicense" + exit 1 +fi From c203aeec0aab8da3e82c6856c62673e29e0ec19f Mon Sep 17 00:00:00 2001 From: Alex Morgan Date: Mon, 30 Mar 2026 11:41:48 -0400 Subject: [PATCH 3/5] chore: add license headers to source files currently without them --- .../java/android-library-module.gradle.kts | 24 +++++++++++++++++++ .../main/java/java-library-module.gradle.kts | 24 +++++++++++++++++++ .../src/main/java/release-module.gradle.kts | 24 +++++++++++++++++++ .../kroger/cache/sampleapp/ui/theme/Color.kt | 24 +++++++++++++++++++ .../cache/sampleapp/ui/theme/Dimensions.kt | 24 +++++++++++++++++++ .../kroger/cache/sampleapp/ui/theme/Theme.kt | 24 +++++++++++++++++++ 6 files changed, 144 insertions(+) diff --git a/buildSrc/src/main/java/android-library-module.gradle.kts b/buildSrc/src/main/java/android-library-module.gradle.kts index efe94fe..63b6336 100644 --- a/buildSrc/src/main/java/android-library-module.gradle.kts +++ b/buildSrc/src/main/java/android-library-module.gradle.kts @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 The Kroger Co. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + plugins { id("com.android.library") kotlin("android") diff --git a/buildSrc/src/main/java/java-library-module.gradle.kts b/buildSrc/src/main/java/java-library-module.gradle.kts index e8ca0a5..bd9c5a3 100644 --- a/buildSrc/src/main/java/java-library-module.gradle.kts +++ b/buildSrc/src/main/java/java-library-module.gradle.kts @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 The Kroger Co. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + plugins { kotlin("jvm") `java-library` diff --git a/buildSrc/src/main/java/release-module.gradle.kts b/buildSrc/src/main/java/release-module.gradle.kts index 27852ad..7d494d0 100644 --- a/buildSrc/src/main/java/release-module.gradle.kts +++ b/buildSrc/src/main/java/release-module.gradle.kts @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 The Kroger Co. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + plugins { id("com.vanniktech.maven.publish") } diff --git a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt index 581909d..bad926c 100644 --- a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt +++ b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 The Kroger Co. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.kroger.cache.sampleapp.ui.theme import androidx.compose.ui.graphics.Color diff --git a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Dimensions.kt b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Dimensions.kt index 1fa64c7..b9f55e1 100644 --- a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Dimensions.kt +++ b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Dimensions.kt @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 The Kroger Co. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.kroger.cache.sampleapp.ui.theme import androidx.compose.runtime.staticCompositionLocalOf diff --git a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Theme.kt b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Theme.kt index 7846b5d..2205b54 100644 --- a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Theme.kt +++ b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Theme.kt @@ -1,3 +1,27 @@ +/* + * MIT License + * + * Copyright (c) 2023 The Kroger Co. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.kroger.cache.sampleapp.ui.theme import androidx.compose.foundation.isSystemInDarkTheme From c48e01076b7dc9c3a9c311fed8d41751ac81be60 Mon Sep 17 00:00:00 2001 From: Alex Morgan Date: Mon, 30 Mar 2026 11:56:22 -0400 Subject: [PATCH 4/5] ci: add PR check job to check license headers ci: separate the two PR check workflows --- .github/workflows/license_check.yml | 22 +++++++++++++++++++ .../{pull_request.yml => title_check.yml} | 1 + 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/license_check.yml rename .github/workflows/{pull_request.yml => title_check.yml} (99%) diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml new file mode 100644 index 0000000..fcfd4d4 --- /dev/null +++ b/.github/workflows/license_check.yml @@ -0,0 +1,22 @@ +name: Pull Request License Check +on: + pull_request: + +jobs: + check_licenses: + name: Check License Headers + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Find Source Files + id: find-files + shell: bash + run: | + echo "SOURCE_FILES=$(find . -path "*/src/*" \( -name "*.java" -o -name "*.kt" -o -name "*.kts" \) -type f -exec printf "%s " {} \;)" >> "$GITHUB_OUTPUT" + + - name: Run addlicense + uses: docker://ghcr.io/google/addlicense:v1.2.0 + with: + args: -v -f LICENSE ${{ steps.find-files.outputs.SOURCE_FILES }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/title_check.yml similarity index 99% rename from .github/workflows/pull_request.yml rename to .github/workflows/title_check.yml index 480aa77..72b705f 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/title_check.yml @@ -5,6 +5,7 @@ on: - opened - reopened - edited + jobs: check_pr_title: name: Check PR Title From 06d35f312b1803e5b0dacd117f376241ebc6426e Mon Sep 17 00:00:00 2001 From: Alex Morgan Date: Mon, 30 Mar 2026 11:57:01 -0400 Subject: [PATCH 5/5] chore: temporarily remove header to test workflow --- .github/workflows/license_check.yml | 2 +- .../kroger/cache/sampleapp/ui/theme/Color.kt | 24 ------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml index fcfd4d4..5a52e81 100644 --- a/.github/workflows/license_check.yml +++ b/.github/workflows/license_check.yml @@ -19,4 +19,4 @@ jobs: - name: Run addlicense uses: docker://ghcr.io/google/addlicense:v1.2.0 with: - args: -v -f LICENSE ${{ steps.find-files.outputs.SOURCE_FILES }} + args: -check -v -f LICENSE ${{ steps.find-files.outputs.SOURCE_FILES }} diff --git a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt index bad926c..581909d 100644 --- a/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt +++ b/sampleapp/src/main/java/com/kroger/cache/sampleapp/ui/theme/Color.kt @@ -1,27 +1,3 @@ -/* - * MIT License - * - * Copyright (c) 2023 The Kroger Co. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - package com.kroger.cache.sampleapp.ui.theme import androidx.compose.ui.graphics.Color