Merge commit '2d92e1d44491d62005e45adcf3dc1c5a403c386f' into less_memory_test_branch

This commit is contained in:
Vitor Pamplona
2023-03-08 17:04:24 -05:00
5 changed files with 52 additions and 1 deletions

View File

@@ -27,6 +27,9 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Linter (gradle)
run: ./gradlew ktlintCheck
- name: Test (gradle)
run: ./gradlew test --no-daemon

View File

@@ -97,11 +97,25 @@ Build the app:
./gradlew connectedAndroidTest
```
## Linting
```bash
./gradlew ktlintCheck
./gradlew ktlintFormat
```
## Installing on device
```bash
./gradlew installDebug
```
## Git Hooks
You can add the git hook running the following bash script:
```bash
./tools/git-hooks/init.sh
```
## How to Deploy
1. Generate a new signing key

View File

@@ -167,3 +167,7 @@ dependencies {
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
}
ktlint {
disabledRules.set(["no-wildcard-imports"])
}

View File

@@ -13,4 +13,11 @@ plugins {
id 'com.android.library' version '7.4.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'org.jetbrains.kotlin.jvm' version '1.8.10' apply false
}
}
task installGitHook(type: Copy) {
from new File(rootProject.rootDir, 'pre-commit')
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0777
}
tasks.getByPath(':app:preBuild').dependsOn installGitHook

23
pre-commit Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
echo "*********************************************************"
echo "Running git pre-commit hook. Running Static analysis... "
echo "*********************************************************"
./gradlew ktlintCheck
status=$?
if [ "$status" = 0 ] ; then
echo "Static analysis found no problems."
exit 0
else
echo "*********************************************************"
echo 1>&2 "Static analysis found violations it could not fix."
printf "Run ${GREEN}./gradlew ktlintFormat${NO_COLOR} to fix formatting related issues...\n"
echo "*********************************************************"
exit 1
fi