Skip to content

Conversation

@cartland
Copy link
Contributor

Snippets from this repository are included in documentation at developer.android.com. Long lines are difficult to read in these snippets (and in general). We previously disabled ktlint for max-line-length because it was difficult to enforce across all snippets. Now we're seeing the challenge appear in the documentation publishing process. Since the snippet line length is not enforced in the code base, teams are adding manual warnings and checks at publishing time to make sure that the line length is not too long.

I am creating this pull request to show which changes will allow max-line-length to be enforced. I will ask teams to review these changes to make sure they don't cause other side effects in the documentation or build process. After everyone is satisfied, we can enforce the line lengths.

@snippet-bot
Copy link

snippet-bot bot commented Nov 6, 2025

No region tags are edited in this PR.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@cartland cartland force-pushed the cartland/line-length branch from 48691b6 to 3f1660d Compare November 6, 2025 07:47
@devbridie
Copy link
Member

I am supportive of this, but I don't see how the modification of the lint rules follow the changes that are suggested in the PR - are there some changes that are manual instead of generated by the linter? Examples on the commits.

.wrapContentWidth()
.padding(8.dp),
style = MaterialTheme.typography.titleSmall
style = MaterialTheme.typography.titleSmall,
Copy link
Member

Choose a reason for hiding this comment

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

Added trailing comma

}
composable(
"details/{id}",
route = "details/{id}",
Copy link
Member

Choose a reason for hiding this comment

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

Named parameter added

) {
Icon(
painter = if (isPressed) painterResource(id = selectedImage) else painterResource(id = unselectedImage),
painter = if (isPressed) {
Copy link
Member

Choose a reason for hiding this comment

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

Brace style fixed

shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)),
surfaceProtection = SurfaceEntity.SurfaceProtection.SURFACE_PROTECTION_PROTECTED
surfaceProtection =
SurfaceEntity.SurfaceProtection.SURFACE_PROTECTION_PROTECTED
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct? I would expect an indent here.

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