Update CONTRIBUTING.md (#589)

* Update CONTRIBUTING.md

Signed-off-by: Matt Ramotar <mramotar@dropbox.com>

* Fix formatting

---------

Signed-off-by: Matt Ramotar <mramotar@dropbox.com>
This commit is contained in:
Matt Ramotar 2023-12-15 11:32:14 -05:00 committed by GitHub
parent ab4d2e088b
commit 35b283204a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 48 deletions

View file

@ -1,42 +1,28 @@
Contributing to Store # Contributing to Store
======================= Thanks for considering contributing to Store. This document provides guidelines and information about how you can contribute.
The Dropbox team welcomes contributions of all kinds, from simple bug reports through documentation, test cases, ## Getting Started
bugfixes, and features. - **Fork the Repository**: Start by forking the [MobileNativeFoundation/Store](https://github.com/MobileNativeFoundation/Store) repository.
- **Clone the Fork**: Clone your fork to your machine to start working on the changes.
DOs and DON'Ts ## Contribution Workflow
-------------- ### Reporting Issues
* Do sign our CLA located here: https://opensource.dropbox.com/cla/ - **Search Existing Issues**: Before creating a new issue, please do a search in existing issues to see if it has been reported or fixed.
* DO follow our coding style (as described below) - **Create a Detailed Issue**: If you find a bug or have a feature request, please create an issue with a clear title and a detailed description.
* DO give priority to the current style of the project or file you're changing even if it diverges from the general guidelines. ### Submitting Changes
* DO include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken. - **Create a Branch**: Create a branch in your fork for your contribution.
* DO keep the discussions focused. When a new or related topic comes up it's often better to create new issue than to side track the discussion. - **Make Your Changes**: Make your changes and commit them to your branch. Make sure to write clear, concise commit messages.
* DO run all Gradle verification tasks (`./gradlew check`) before submitting a pull request - **Write Tests**: If you are adding new features or fixing bugs, write tests that cover your changes.
- **Run the Tests**: Run the project's existing tests to ensure nothing is broken.
- **Create a Pull Request**: Submit a PR to the main repository for review. Include a clear description of the changes and any relevant issue numbers.
### Code Review Process
- **Wait for Review**: Maintainers will review your PR and might request changes.
- **Make Requested Changes**: If changes are requested, make them and update your PR.
- **Merge**: Once your PR is approved, a maintainer will merge it into the main codebase.
* DO NOT send PRs for style changes. ## Community Guidelines
* DON'T surprise us with big pull requests. Instead, file an issue and start a discussion so we can agree on a direction before you invest a large amount of time. - **Be Respectful**: Treat everyone with respect. We strive to create a welcoming and inclusive environment.
* DON'T commit code that you didn't write. If you find code that you think is a good fit, file an issue and start a discussion before proceeding. - **Follow the Code of Conduct**: Familiarize yourself with our [Code of Conduct](https://github.com/MobileNativeFoundation/Store/blob/main/CODE_OF_CONDUCT.md).
* DON'T submit PRs that alter licensing related files or headers. If you believe there's a problem with them, file an issue and we'll be happy to discuss it.
## Getting Help
Coding Style - **Join the Community**: If you have questions or need help, join our [Slack channel](https://kotlinlang.slack.com/archives/C06007Z01HU).
------------
The coding style employed here is fairly conventional Java - indentations are four spaces, class
names are PascalCased, identifiers and methods are camelCased.
We use [ktlint](https://github.com/pinterest/ktlint) with the [ktlint gradle plugin](https://github.com/JLLeitschuh/ktlint-gradle) for Kotlin code formatting.
To make sure the IDE agrees with rules we use, please run `./gradlew ktlintApplyToIdea` to generate IntelliJ IDEA / Android Studio Kotlin style files in the project .idea/ folder.
Workflow
--------
We love Github issues! Before working on any new features, please open an issue so that we can agree on the
direction, and hopefully avoid investing a lot of time on a feature that might need reworking.
Small pull requests for things like typos, bugfixes, etc are always welcome.
Please note that we will not accept pull requests for style changes.
We use the [binary-compatibility-validator plugin](https://github.com/Kotlin/binary-compatibility-validator) for tracking the binary compatibility of the APIs we ship.
If your change implies changes to any public API, run `./gradlew apiDump` to generate the updated API dumps and commit those changes.

View file

@ -1,6 +1,5 @@
package org.mobilenativefoundation.store.store5 package org.mobilenativefoundation.store.store5
import co.touchlab.kermit.Logger
import kotlinx.atomicfu.atomic import kotlinx.atomicfu.atomic
import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.first
import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.TestScope
@ -34,10 +33,12 @@ class LocalOnlyTests {
fun givenPrimedMemoryCacheThenCacheOnlyRequestReturnsData() = testScope.runTest { fun givenPrimedMemoryCacheThenCacheOnlyRequestReturnsData() = testScope.runTest {
val fetcherHitCounter = atomic(0) val fetcherHitCounter = atomic(0)
val store = StoreBuilder val store = StoreBuilder
.from(Fetcher.of { _: Int -> .from(
fetcherHitCounter += 1 Fetcher.of { _: Int ->
"result" fetcherHitCounter += 1
}) "result"
}
)
.cachePolicy( .cachePolicy(
MemoryPolicy MemoryPolicy
.builder<Any, Any>() .builder<Any, Any>()
@ -56,10 +57,12 @@ class LocalOnlyTests {
fun givenInvalidMemoryCacheThenCacheOnlyRequestReturnsNoNewData() = testScope.runTest { fun givenInvalidMemoryCacheThenCacheOnlyRequestReturnsNoNewData() = testScope.runTest {
val fetcherHitCounter = atomic(0) val fetcherHitCounter = atomic(0)
val store = StoreBuilder val store = StoreBuilder
.from(Fetcher.of { _: Int -> .from(
fetcherHitCounter += 1 Fetcher.of { _: Int ->
"result" fetcherHitCounter += 1
}) "result"
}
)
.cachePolicy( .cachePolicy(
MemoryPolicy MemoryPolicy
.builder<Any, Any>() .builder<Any, Any>()