Skip to content

Conversation

mlykotom
Copy link
Contributor

Jetcaster is refactored in #1561, so the same config will be applied there, but I won't format it here, because it would create a million conflicts.

mlykotom added 2 commits May 16, 2025 12:47
Jetcaster format is fixed in a separate PR.
I'm doing it this way to prevent million of conflicts, because Jetcaster has major redesign
@mlykotom mlykotom requested a review from a team as a code owner May 16, 2025 10:53
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @mlykotom, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request focuses on improving the code formatting consistency across the Jetsnack sample application by applying Spotless code formatting to all samples except Jetcaster. The Jetcaster sample will be formatted in a separate pull request due to its refactoring in progress. The changes include adding a .editorconfig file, updating build.gradle.kts files, and reformatting several Kotlin files to adhere to the configured code style.

Highlights

  • Spotless Configuration: Configures Spotless Gradle plugin to enforce consistent code formatting across the project.
  • Kotlin Formatting: Applies ktlint formatting to all Kotlin (.kt) and Kotlin script (.kts) files, excluding the Jetcaster sample.
  • EditorConfig: Adds a .editorconfig file to define code style rules for Kotlin files.
  • Gradle Updates: Updates build.gradle.kts files to use the new Spotless configuration and correct a URL.

Changelog

Click here to see the changelog
  • JetLagged/.editorconfig
    • Added .editorconfig file to define code style rules.
  • JetLagged/app/build.gradle.kts
    • Updated the Apache license URL from http to https.
    • Added a blank line before the plugins block.
    • Formatted proguardFiles calls for better readability.
  • JetLagged/app/src/main/java/com/example/jetlagged/HomeScreenCards.kt
    • Reformatted the BasicInformationalCard, TwoLineInfoCard, AverageTimeInBedCard, AverageTimeAsleepCard, WellnessCard, WellnessBubble, and HomeScreenCardHeading composables to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/JetLaggedDrawer.kt
    • Reformatted the HomeScreenDrawer and ScreenContents composables, and the HomeScreenDrawerContents composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/JetLaggedScreen.kt
    • Reformatted the JetLaggedScreen composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/backgrounds/BubbleBackground.kt
    • Reformatted the BubbleBackground composable and BackgroundBubbleData data class to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/backgrounds/FadingCircleBackground.kt
    • Reformatted the FadingCircleBackground composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/backgrounds/SimpleGradientBackground.kt
    • Reformatted the simpleGradient modifier function to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/backgrounds/SolarFlareShaderBackground.kt
    • Reformatted the solarFlareShaderBackground modifier function and SolarFlairShaderBackgroundNode class to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/backgrounds/StripesShaderBackground.kt
    • Reformatted the MovingStripesBackgroundElement data class, MovingStripesBackgroundNode class, and movingStripesBackground modifier function to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/data/FakeSleepData.kt
    • Reformatted the sleepData variable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/data/JetLaggedHomeScreenState.kt
    • Reformatted the JetLaggedHomeScreenState, WellnessData, and HeartRateOverallData data classes to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/heartrate/HeartRateCard.kt
    • Reformatted the HeartRateCard composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/heartrate/HeartRateGraph.kt
    • Reformatted the HeartRateGraph composable, Graph composable, DataPoint sealed class, and generateSmoothPath function to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/sleep/JetLaggedHeader.kt
    • Reformatted the JetLaggedHeader composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/sleep/JetLaggedHeaderTabs.kt
    • Reformatted the SleepTab enum, JetLaggedHeaderTabs composable, and SleepTabText composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/sleep/JetLaggedTimeGraph.kt
    • Reformatted the JetLaggedSleepGraphCard composable and JetLaggedTimeGraph composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/sleep/SleepBar.kt
    • Reformatted the SleepBar composable, SleepRoundedBar composable, and DetailLegend composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/sleep/SleepData.kt
    • Reformatted the SleepGraphData, SleepDayData, SleepPeriod data classes, and SleepType enum to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/sleep/TimeGraph.kt
    • Reformatted the TimeGraph composable, TimeGraphScope object, and TimeGraphParentData class to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/ui/theme/Theme.kt
    • Reformatted the LightColorScheme, DarkColorScheme, JetLaggedExtraColors data class, and JetLaggedTheme composable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/ui/theme/Type.kt
    • Reformatted the fontName variable, provider variable, fontFamily variable, Typography variable, TitleBarStyle variable, HeadingStyle variable, SmallHeadingStyle variable, LegendHeadingStyle variable, and TitleStyle variable to adhere to the configured code style.
  • JetLagged/app/src/main/java/com/example/jetlagged/ui/util/MultiDevicePreview.kt
    • Reformatted the FontScalePreviews annotation class to adhere to the configured code style.
  • JetNews/.editorconfig
    • Added .editorconfig file to define code style rules.
  • JetNews/app/build.gradle.kts
    • Updated the Apache license URL from http to https.
    • Added a blank line before the plugins block.
    • Formatted proguardFiles calls for better readability.
  • JetNews/app/src/androidTest/java/com/example/jetnews/HomeScreenTests.kt
    • Reformatted the HomeScreenTests class to adhere to the configured code style.
  • JetNews/app/src/androidTest/java/com/example/jetnews/JetnewsTests.kt
    • Reformatted the JetnewsTests class to adhere to the configured code style.
  • JetNews/app/src/androidTest/java/com/example/jetnews/TestHelper.kt
    • Reformatted the launchJetNewsApp function to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/data/interests/impl/FakeInterestsRepository.kt
    • Reformatted the FakeInterestsRepository class to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/data/posts/impl/PostsData.kt
    • Reformatted the pietro variable, manuel variable, florina variable, androidstudioteam variable, publication variable, and paragraphsPost1 variable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/glance/ui/Divider.kt
    • Reformatted the Divider composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/glance/ui/JetnewsGlanceAppWidget.kt
    • Reformatted the JetnewsGlanceAppWidget class to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/glance/ui/Post.kt
    • Reformatted the Post composable, DataPoint sealed class, and generateSmoothPath function to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/glance/ui/theme/Theme.kt
    • Reformatted the JetnewsGlanceColorScheme object to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/model/Post.kt
    • Reformatted the Post data class, Metadata data class, PostAuthor data class, Publication data class, Paragraph data class, and Markup data class to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/AppDrawer.kt
    • Reformatted the AppDrawer composable and JetNewsLogo composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/JetnewsApp.kt
    • Reformatted the JetnewsApp composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/JetnewsNavGraph.kt
    • Reformatted the JetnewsNavGraph function to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/article/ArticleScreen.kt
    • Reformatted the ArticleScreen composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/article/PostContent.kt
    • Reformatted the PostContent composable, Paragraph composable, and generateSleepPath function to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/components/AppNavRail.kt
    • Reformatted the AppNavRail composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/components/JetnewsSnackbarHost.kt
    • Reformatted the JetnewsSnackbarHost composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/home/HomeRoute.kt
    • Reformatted the HomeRoute composable and getHomeScreenType function to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/home/HomeScreens.kt
    • Reformatted the HomeFeedWithArticleDetailsScreen composable and HomeFeedScreen composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/home/HomeViewModel.kt
    • Reformatted the HomeViewModel class to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/home/PostCardTop.kt
    • Reformatted the PostCardTop composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/home/PostCardYourNetwork.kt
    • Reformatted the PostCardPopular composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/sleep/SleepBar.kt
    • Reformatted the SleepBar composable and SleepRoundedBar composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/sleep/SleepData.kt
    • Reformatted the SleepGraphData data class, SleepDayData data class, SleepPeriod data class, and SleepType enum to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/theme/Theme.kt
    • Reformatted the JetnewsTheme composable to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/theme/Type.kt
    • Reformatted the Typography object to adhere to the configured code style.
  • JetNews/app/src/main/java/com/example/jetnews/ui/util/MultiDevicePreview.kt
    • Reformatted the FontScalePreviews annotation class to adhere to the configured code style.
  • Reply/.editorconfig
    • Added .editorconfig file to define code style rules.
  • Reply/app/build.gradle.kts
    • Updated the copyright notice to The Android Open Source Project.
    • Added a blank line before the plugins block.
    • Formatted proguardFiles calls for better readability.
  • Reply/app/src/main/java/com/example/reply/data/Account.kt
    • Reformatted the Account data class to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/data/Email.kt
    • Reformatted the Email data class to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/data/EmailAttachment.kt
    • Reformatted the EmailAttachment data class to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/data/MailboxType.kt
    • Reformatted the MailboxType enum to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/data/local/LocalAccountsDataProvider.kt
    • Reformatted the LocalAccountsDataProvider object to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/data/local/LocalEmailsDataProvider.kt
    • Reformatted the LocalEmailsDataProvider object to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/EmptyComingSoon.kt
    • Reformatted the EmptyComingSoon composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/MainActivity.kt
    • Reformatted the MainActivity class to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/ReplyApp.kt
    • Reformatted the ReplyApp composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/ReplyHomeViewModel.kt
    • Reformatted the ReplyHomeViewModel class to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/ReplyListContent.kt
    • Reformatted the ReplyInboxScreen composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/components/AppNavRail.kt
    • Reformatted the AppNavRail composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/components/JetnewsSnackbarHost.kt
    • Reformatted the JetnewsSnackbarHost composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/components/ReplyAppBars.kt
    • Reformatted the ReplyDockedSearchBar composable and EmailDetailAppBar composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/components/ReplyEmailListItem.kt
    • Reformatted the ReplyEmailListItem composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/components/ReplyProfileImage.kt
    • Reformatted the ReplyProfileImage composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/navigation/ReplyNavigationActions.kt
    • Reformatted the ReplyNavigationActions class to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/navigation/ReplyNavigationComponents.kt
    • Reformatted the ReplyNavigationWrapper composable and ReplyBottomNavigationBar composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/theme/Shape.kt
    • Reformatted the shapes object to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/theme/Theme.kt
    • Reformatted the ReplyTheme composable to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/theme/Type.kt
    • Reformatted the replyTypography object to adhere to the configured code style.
  • Reply/app/src/main/java/com/example/reply/ui/utils/WindowStateUtils.kt
    • Reformatted the DevicePosture sealed interface and ReplyNavigationType enum to adhere to the configured code style.
  • scripts/format.sh
    • Updated the format.sh script to remove the --init-script argument and pass the remaining arguments directly to the gradlew_recursive.sh script.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A spotless code,
A joy to behold and share,
Cleanliness reigns.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively standardizes and applies the Spotless configuration across multiple sample projects, which is a great step towards consistent code style and maintainability. The move to .editorconfig for ktlint rules and the simplification of the build.gradle.kts files are positive changes.

The formatting applied throughout the Kotlin files aligns with the new configuration and generally improves readability and consistency. The update to the format.sh script and the removal of the old init.gradle.kts are also appropriate.

Overall, the changes are well-executed and contribute positively to the codebase. Nice work!

Summary of Findings

  • Redundant ktlint rule in .editorconfig: In the newly added .editorconfig files for JetLagged, JetNews, Jetchat, Jetsnack, and Reply, the line ktlint_standard_package-name = disabled is duplicated (e.g., line 10 and line 19 in JetLagged/.editorconfig). While this doesn't break functionality, removing the duplicate line would make the configuration cleaner. (Severity: low - Not commented due to review settings)

Merge Readiness

The pull request appears to be in good shape and ready for merging. The identified minor issue (duplicated lines in .editorconfig) is of low severity and can be addressed at the author's discretion or in a follow-up. As I am an AI, I am not authorized to approve pull requests; please ensure other reviewers approve this code before merging.

@mlykotom mlykotom requested a review from bentrengrove May 21, 2025 20:19
Copy link
Member

@bentrengrove bentrengrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also fix the GitHub action not auto applying spotless?

@mlykotom
Copy link
Contributor Author

Does this also fix the GitHub action not auto applying spotless?

Yeah it does. We had outdated configuration that didn't work already. The GH actions run properly spotlessCheck and the configuration is now correct in all samples.

@mlykotom mlykotom merged commit 6ef0974 into main May 21, 2025
18 checks passed
@mlykotom mlykotom deleted the mlykotom/all-fix-spotless branch May 21, 2025 21:21
@mlykotom mlykotom restored the mlykotom/all-fix-spotless branch May 21, 2025 21:21
@mlykotom mlykotom deleted the mlykotom/all-fix-spotless branch May 21, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants