Skip to content

Commit

Permalink
Merge branch 'main' into albendz_complexcondition
Browse files Browse the repository at this point in the history
  • Loading branch information
albendz committed Oct 23, 2024
2 parents d03787e + 90c9205 commit 3a257fa
Show file tree
Hide file tree
Showing 132 changed files with 819 additions and 9,521 deletions.
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Thank you for your pull request! 🚀
<!-- Please replace the empty checkboxes [] below with checked ones [x] accordingly. -->

- [] This pull request is on a [separate branch](https://docs.github.com/en/get-started/quickstart/github-flow) and not the main branch
- [] I have tested my code with the `./gradlew lintKotlin detekt test` command as directed in the [testing section of the contributing guide](https://github.com/scribe-org/Scribe-Data/blob/main/CONTRIBUTING.md#testing)

---

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr_ktlint_detekt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
distribution: "zulu"
java-version: 17
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/pr_unit_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pr_unit_test
on:
pull_request:
branches:
- main
types: [opened, reopened, synchronize]

jobs:
unit-test:
runs-on: ubuntu-latest
name: Run unit tests

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

- name: Setup JDK environment
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: 17
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Run tests
run: ./gradlew test
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ If you have questions or would like to communicate with the team, please [join u
- [First steps as a contributor](#first-steps)
- [Learning the tech stack](#learning-the-tech)
- [Development environment](#dev-env)
- [Testing](#testing)
- [Issues and projects](#issues-projects)
- [Bug reports](#bug-reports)
- [Feature requests](#feature-requests)
Expand Down Expand Up @@ -119,6 +120,43 @@ git remote add upstream https://github.com/scribe-org/Scribe-Android.git
> [!NOTE]
> Feel free to contact the team in the [Android room on Matrix](https://matrix.to/#/#ScribeAndroid:matrix.org) if you're having problems getting your environment setup!
## Pre-commit Hooks [``](#contents)

Scribe-Android uses pre-commit hooks to maintain a clean and consistent codebase. These hooks help automatically check for issues such as formatting, trailing whitespace, and linting errors. Here's how to set up pre-commit for Scribe-Android:

1. Install `pre-commit` by running:

```bash
pip install pre-commit
```

2. After cloning the repository, install the hooks by running the following command in the project root:

```bash
pre-commit install
pre-commit run --all-files # to check
```

3. When you make a commit, the hooks will automatically run to check for any code quality issues. If any issues are found, they will either be fixed automatically or will need to be resolved manually.

<a id="testing"></a>

## Testing [`⇧`](#contents)

In addition to the [pre-commit](https://pre-commit.com/) hooks that are set up during the [development environment section](#dev-env), Scribe-Android includes a testing suite that should be ran before all pull requests and subsequent commits. Please run the following in the project root:

```bash
# Run ktlint and detekt:
./gradlew lintKotlin detekt
./gradlew test
```

If you see that there are linting errors above, then please run the following command to hopefully fix them automatically:

```bash
ktlint --format
```

<a id="issues-projects"></a>

# Issues and projects [`⇧`](#contents)
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ git remote add upstream https://github.com/scribe-org/Scribe-Android.git
- Press the play button marked "Run App"
- From here code edits that are made will be reflected in the app each time it is ran.

After activating your emulator, consider setting up [pre-commit](https://pre-commit.com/) to fix common errors in the codebase before they're committed by running:

```bash
pip install --upgrade pip # make sure that pip is at the latest version
pip install pre-commit
pre-commit install # install pre-commit hooks
# pre-commit run --all-files # lint and fix common problems in the codebase
```

> [!NOTE]
> Feel free to contact the team in the [Android room on Matrix](https://matrix.to/#/#ScribeAndroid:matrix.org) if you're having problems getting your environment setup!
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/be/scri/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package be.scri

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import be.scri.extensions.checkUseEnglish
import be.scri.extensions.config

class App : Application() {
Expand All @@ -15,6 +14,5 @@ class App : Application() {
},
)
super.onCreate()
checkUseEnglish()
}
}
Loading

0 comments on commit 3a257fa

Please sign in to comment.