Skip to content

Commit

Permalink
refactor: remove putIfNotNull and use put API and add PR template (#96)
Browse files Browse the repository at this point in the history
* refactor: remove putIfNotNull and use put

As value is not null, we don't need to use putIfNotNull API.

* chore: add pull_request_template.md
  • Loading branch information
1abhishekpandey authored Jan 8, 2025
1 parent dd9fecb commit 4c68139
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
43 changes: 43 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Description
<!-- Please include a summary of the change and which issue is fixed or features are added. Also, provide relevant motivation and context. If this is a breaking change, explain why and what to expect. -->

## Type of change
<!-- Please delete options that are not relevant. -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactor/optimization

## Implementation Details
<!-- Please include a summary of the technical changes and which issue is fixed or features are added. -->
- ...
- ...

## Checklist
<!-- Please ensure that your pull request meets the following requirements by checking the boxes. If something is not applicable, leave it unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added the necessary documentation (if appropriate).
- [ ] I have ensured that my code follows the project's code style.
- [ ] I have checked for potential performance impacts and optimized if necessary.
- [ ] I have checked the code for security issues.
- [ ] I have updated the changelog (if required).

## How to test?
<!-- Please describe the tests that you ran to verify your changes. Include details about the test environment, test cases, and results. Attach test logs if possible. -->

## Breaking Changes
<!-- If this PR introduces breaking changes, list them here, explaining what is broken and how users can migrate their existing code. -->

## Maintainers Checklist
<!-- This section is for project maintainers to use before merging the PR. -->
- [ ] The code has been reviewed.
- [ ] CI tests have passed.
- [ ] All necessary documentation has been updated.

## Screenshots (if applicable)
<!-- If your changes involve a UI update, provide before and after screenshots to illustrate your changes. -->
<img src="https://github.com/link" height="400" />

## Additional Context
<!-- Add any other context or information about the pull request that might be helpful, such as related PRs, references, discussions, etc. -->
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.rudderstack.sdk.kotlin.core.internals.models.emptyJsonObject
import com.rudderstack.sdk.kotlin.core.internals.plugins.Plugin
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.buildJsonObject
import kotlinx.serialization.json.put
import org.jetbrains.annotations.VisibleForTesting

private const val APP_KEY = "app"
Expand Down Expand Up @@ -63,9 +64,9 @@ internal class AppInfoPlugin : Plugin {
APP_KEY,
buildJsonObject {
putIfNotNull(APP_NAME_KEY, it.applicationInfo?.loadLabel(packageManager))
putIfNotNull(APP_NAMESPACE_KEY, it.packageName)
putIfNotNull(APP_VERSION_KEY, it.versionName)
putIfNotNull(APP_BUILD_KEY, appBuild)
put(APP_NAMESPACE_KEY, it.packageName)
put(APP_VERSION_KEY, it.versionName)
put(APP_BUILD_KEY, appBuild)
}
)
}
Expand Down

0 comments on commit 4c68139

Please sign in to comment.