Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.{kt,kts}]
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
ktlint_function_naming_ignore_when_annotated_with = Composable, Test, Preview
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ChochaNaresh
9 changes: 9 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing to formz

We welcome pull requests! Please follow these _guidelines_:

- Create issues for bugs and features.
- Fork and create feature branches (e.g., `feature/pick-*`).
- Follow existing code style and naming conventions.
- Run tests with `./gradlew test` before submitting a PR.
- Add documentation for any new public APIs.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: ChochaNaresh
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: [bug]
assignees: []

body:
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: The app crashes when...
validations:
required: true

- type: input
attributes:
label: Library Version
placeholder: e.g. 1.0.0-beta.1
validations:
required: true

- type: textarea
attributes:
label: Steps to reproduce
placeholder: |
1. Import library
2. Call formz
3. App crashes
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a Question
url: https://github.com/ChochaNaresh/Formz/discussions
about: Please ask and answer questions in GitHub Discussions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Feature Request
description: Suggest a new feature or improvement
title: "[Feature]: "
labels: [enhancement]
assignees: []

body:
- type: textarea
attributes:
label: Feature Description
description: What feature would you like to see?
validations:
required: true

- type: textarea
attributes:
label: Use case or motivation
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## ✨ What's Changed

Describe the changes you made in this PR.

## ✅ Checklist

- [ ] I've tested this on a device/emulator
- [ ] I've added tests where applicable
- [ ] I've updated documentation (if needed)
- [ ] This PR follows the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines
96 changes: 96 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Android CI/CD

on:
push:
branches: [main, master]
tags:
- '[0-9]*' # matches 1.0.0, 0.1.0-alpha etc.
pull_request:
branches: [main, master]

permissions:
contents: write # Required to create GitHub Releases

jobs:
check:
name: Code Style & Formatting
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Run checks
run: ./gradlew formz:spotlessCheck detekt

- name: Upload Detekt HTML report
uses: actions/upload-artifact@v4
with:
name: detekt-html-report
path: |
**/build/reports/detekt/detekt.html
build:
name: Build & Test
needs: check
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Run unit tests
run: ./gradlew formz:testDebugUnitTest

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/build/test-results/testDebugUnitTest/'

- name: Build library
run: ./gradlew formz:build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
**/build/outputs/aar/*.aar
**/build/libs/*.jar
53 changes: 53 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,60 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.gradle.spotless.SpotlessPlugin
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.arturbosch.detekt) apply false
alias(libs.plugins.spotless) apply false
}

val detektVersion = libs.versions.detekt.get()
subprojects {
// formatting code for all subprojects
apply<SpotlessPlugin>()
configure<SpotlessExtension> {
kotlin {
target("src/**/*.kt")
targetExclude("build/**/*.kt")
ktlint()
endWithNewline()
}
kotlinGradle {
target("*.kts")
ktlint()
}
}
// code analysis for all subprojects
apply<DetektPlugin>()
configure<DetektExtension> {
toolVersion = detektVersion
config.from("$rootDir/config/detekt/detekt.yml")
buildUponDefaultConfig = true
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
reports {
xml.required.set(false)
html.required.set(true)
txt.required.set(false)
}
}

afterEvaluate {
tasks.withType<KotlinCompile> {
finalizedBy("spotlessApply")
}

tasks.withType<KotlinCompile> {
finalizedBy("detekt")
}

}
}
Loading