mobile-wallet/scripts/pre-commit.sh
Sk Niyaj Ali 3782fd0d6f
Merge kmm-impl into dev (#1813)
* Feat: KMP Library Setup (#1766)

* Migrating from hilt to koin (This) (#1764)

* Migrating from hilt to koin

* Fixed Instance creation error

* refactor: Removed Hilt and migrated to Koin

This commit removes Hilt and migrates the project to Koin for dependency injection.

The following
 changes were made:

- Removed the `AndroidHiltConventionPlugin`.
- Added the `AndroidKoinConventionPlugin`.
- Updated dependencies to use Koin.
- Updated KSP configuration for Koin.
- Updated feature modules to use Koin.
- Updated common modules to use Koin
.
- Removed Hilt annotations and replaced them with Koin annotations.
- Updated ViewModels to use Koin for dependency injection.
- Updated modules to use Koin for dependency injection.

* Formatted Dependencies

* migrating from hilt to koin clean up commit

* Revert "migrating from hilt to koin clean up commit"

This reverts commit bb63058e49.

---------

Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>

* Feat: KMP Library Setup

---------

Co-authored-by: Nagarjuna <99315689+Nagarjuna0033@users.noreply.github.com>

* Feat: [:core:model] - Migrated to KMM (#1770)

* Feat: [:core:common] KMP Migration (#1768)

* Feat: [:core:common] KMP Migration

* Updated Usage Declaration

* Feat: [:core:datastore] - Migrated to KMP (#1769)

* Feat: [:core:network] - Migrated to KMP (#1772)

* Feat: [:core:network] - Migrated to KMP

* Feat: [:core:data] - Migrated to KMP Library

* Feat: [:core:designsystem] - Migrated to KMP with CMP Library (#1774)

* Feat: [:core:ui] - Migrated to KMP with CMP Library (#1775)

* Feat: [:feature:auth] - Migrated to Kotlin Multiplatform (#1782)

* Feat: [:feature:auth] - Migrated to Kotlin Multiplatform

* Added Support For Web

* Feat: Migrated Passcode Module to KMP (#1783)

* Feat: Migrated Home Module to KMP (#1784)

* Feat: Migrated Edit Password Module to KMP (#1787)

* Feat: Migrated FAQ module to kmp (#1786)

* Feat: Migrated Settings Module to KMP (#1785)

* Feat: Migrated Profile Module to KMP (#1788)

* Feat: Migrated History Module to KMP (#1790)

* Feat: Migrated Payments Module to KMP (#1791)

* Feat: Migrated Finance Module to KMP (#1792)

* Feat: Migrated Accounts Module to KMP (#1793)

* Feat: Migrated Accounts Module to KMP

* Updated README.md

* Update README.md

* Feat: Migrated Invoices Module to KMP (#1794)

* Feat: Migrated KYC Module to KMP (#1798)

* Migrated Notification Module to KMP (#1799)

* Feat: Migrated KYC Module to KMP

* Feat: Migrated Notification Module to KMP

* Feat: Migrated Saved Card Module to KMP (#1800)

* Feat: Migrated Receipt Module to KMP (#1801)

* fix: Ios Build (#1802)

* Feat: Migrated SI Module to KMP (#1803)

* Feat: Migrated Request Money Module to KMP (#1807)

* Feat: Migrated Send Money Module to KMP (#1808)

* Feat: Migrated Make Transfer Module to KMP (#1809)

* Feat: Migrated QR Module to KMP (#1810)

* Feat: Migrated UPI Setup Module to KMP (#1811)

* Feat: Final Clean-up For KMP (#1812)

* Feat: Final Cleanup For KMP

* Update README.md

* Update EditPassword README.md

* Update FAQ README.md

* Update Finance README.md

* Update History README.md

* Update Home README.md

* Update Invoice README.md

* Update KYC README.md

* Update Make Transfer README.md

* Update Notification README.md

* Update Payments README.md

* Update Profile README.md

* Update Saved Card README.md

* Update Send Money README.md

* Update Settings README.md

* Update SI README.md

* Migrating from hilt to koin (This) (#1764)

* Migrating from hilt to koin

* Fixed Instance creation error

* refactor: Removed Hilt and migrated to Koin

This commit removes Hilt and migrates the project to Koin for dependency injection.

The following
 changes were made:

- Removed the `AndroidHiltConventionPlugin`.
- Added the `AndroidKoinConventionPlugin`.
- Updated dependencies to use Koin.
- Updated KSP configuration for Koin.
- Updated feature modules to use Koin.
- Updated common modules to use Koin
.
- Removed Hilt annotations and replaced them with Koin annotations.
- Updated ViewModels to use Koin for dependency injection.
- Updated modules to use Koin for dependency injection.

* Formatted Dependencies

* migrating from hilt to koin clean up commit

* Revert "migrating from hilt to koin clean up commit"

This reverts commit bb63058e49.

---------

Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>

* Profile UI redesign  (#1767)

* Refactor Profile UI

* Fixed Build Issue

* Profile UI Bug Fix & Improvement

* added placeholder for  when uri is null

cleanup

fix spotless test failure

* Fix - CI Build Issue

---------

Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>

* refactor: Redesign payment screen (#1773)

* refactor: Redesign payment screen

* resolved detekt error

* refactor : changed current theme instead of using NewUi

* resolved spotless errors

* refactor: Redesign finance screen (#1777)

* refactor: Redesign payment screen

* resolved detekt error

* refactor : changed current theme instead of using NewUi

* resolved spotless errors

* refactor: Redesign finance screen UI

* resolved spotless errors

* resolved conflicts

* changed structure of accounts screen

* refactor padding values in finance screen

* fix: dark theme colors (#1789)

* fix: dark theme colors

* fixed edit icon tint

* Fix invoice api (#1797)

* Redesign requeset screen UI

* fix MissingKoinDefinitionException

* removed comments and fixed share qr code bug

* fix: Invoice APIs

* update readme file (#1804)

* update readme file

* update readme file

* update readme file with how to contribute

* Add branch policy (#1805)

* update readme file

* update readme file

* update readme file with how to contribute

* update readme file with how to contribute

* update readme file with branch Policy

---------

Co-authored-by: Rajan Maurya <therajanmaurya@users.noreply.github.com>

* Migrating from hilt to koin (This) (#1764)

* Migrating from hilt to koin

* Fixed Instance creation error

* refactor: Removed Hilt and migrated to Koin

This commit removes Hilt and migrates the project to Koin for dependency injection.

The following
 changes were made:

- Removed the `AndroidHiltConventionPlugin`.
- Added the `AndroidKoinConventionPlugin`.
- Updated dependencies to use Koin.
- Updated KSP configuration for Koin.
- Updated feature modules to use Koin.
- Updated common modules to use Koin
.
- Removed Hilt annotations and replaced them with Koin annotations.
- Updated ViewModels to use Koin for dependency injection.
- Updated modules to use Koin for dependency injection.

* Formatted Dependencies

* migrating from hilt to koin clean up commit

* Revert "migrating from hilt to koin clean up commit"

This reverts commit bb63058e49.

---------

Co-authored-by: Sk Niyaj Ali <niyaj639@gmail.com>

* Merge kmm-impl to dev

---------

Co-authored-by: Nagarjuna <99315689+Nagarjuna0033@users.noreply.github.com>
Co-authored-by: Rajan Maurya <therajanmaurya@users.noreply.github.com>
Co-authored-by: Pronay Sarker <pronaycoding@gmail.com>
Co-authored-by: kapmaurya <152150716+kapmaurya@users.noreply.github.com>
2024-11-06 10:22:46 -05:00

95 lines
4.2 KiB
Bash

#!/bin/sh
# Function to check the current branch
check_current_branch() {
echo "\n🚀 Checking the current git branch..."
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$CURRENT_BRANCH" = "master" ] || [ "$CURRENT_BRANCH" = "dev" ]; then
echo "🛑 Hold it right there! Committing directly to the '$CURRENT_BRANCH' branch? That's a big no-no!"
echo "🚫 Direct commits to '$CURRENT_BRANCH' are like trying to use a wrench to write code—doesn't work! 😜"
echo "\nABORTING COMMIT: You must navigate to a feature branch or create a new one to save the day! 🦸‍♂️🦸‍♀️\n"
exit 1
else
echo "✅ Fantastic! You're on the '$CURRENT_BRANCH' branch, which is perfect for commits. Let's keep this awesome momentum going! 🚀✨"
fi
}
# Function to run Spotless checks
run_spotless_checks() {
echo "\n🚀 Spotless is now analyzing and formatting your code!"
./gradlew spotlessApply --no-configuration-cache --daemon > /tmp/spotless-result
SPOTLESS_EXIT_CODE=$?
if [ ${SPOTLESS_EXIT_CODE} -ne 0 ]; then
cat /tmp/spotless-result
rm /tmp/spotless-result
echo "\n*********************************************************************************"
echo " 💥 Uh-oh! Spotless found formatting issues in the code! Time to tidy up! 💥"
echo " 💡 Tip: Check the reported issues and fix formatting errors. 🛠️"
echo "*********************************************************************************"
exit ${SPOTLESS_EXIT_CODE}
else
rm /tmp/spotless-result
echo "🎉 Stellar job! Your code is pristine and has passed Spotless's formatting checks without a hitch! Keep shining bright! ✨🚀"
fi
}
# Function to run ktlint checks
run_dependency_guard() {
printf "\n🚀 Brace yourself! We're about to generate dependency guard baseline!"
./gradlew dependencyGuardBaseline > /tmp/dependency-result
KT_EXIT_CODE=$?
if [ ${KT_EXIT_CODE} -ne 0 ]; then
cat /tmp/dependency-result
rm /tmp/dependency-result
printf "\n*********************************************************************************"
echo " 💥 Oh no! Something went wrong! 💥"
echo " 💡 Unable to generate dependency baseline. 🛠️"
printf "*********************************************************************************\n"
exit ${KT_EXIT_CODE}
else
rm /tmp/dependency-result
echo "🎉 Bravo! Dependency baseline has been generated successfully! Keep rocking that clean code! 🚀💫"
fi
}
# Function to run Detekt checks
run_detekt_checks() {
echo "\n🚀 Detekt is now analyzing your Kotlin code for potential issues!"
./gradlew detekt > /tmp/detekt-result
DETEKT_EXIT_CODE=$?
if [ ${DETEKT_EXIT_CODE} -ne 0 ]; then
cat /tmp/detekt-result
rm /tmp/detekt-result
echo "\n*********************************************************************************"
echo " 💥 Oh no! Detekt found issues in the code! Time to fix those issues! 💥"
echo " 💡 Tip: Review the Detekt report to resolve these issues. 🛠️"
echo "*********************************************************************************"
exit ${DETEKT_EXIT_CODE}
else
rm /tmp/detekt-result
echo "🎉 Fantastic work! Your Kotlin code has sailed through Detekt's analysis with ease! Onward to greatness! 🚀🌟"
fi
}
# Function to print success message
print_success_message() {
GIT_USERNAME=$(git config user.name)
echo "\n *******************************************************************************"
echo "🚀🎉 Huzzah, $GIT_USERNAME! Your code has triumphed through the Style Checker Dragon unscathed! 🐉"
echo "Your code shines brighter than a supernova and sparkles like a constellation of stars! ✨🌌"
echo "*******************************************************************************"
echo "\n🚀🎉 Hold tight, $GIT_USERNAME! Your code is ready to commit and conquer new heights! 🌟✨ Keep up the amazing work! 💪\n"
}
# Main script execution
check_current_branch
run_spotless_checks
run_detekt_checks
run_dependency_guard
print_success_message
exit 0