Skip to content

More accurate spotless config #4499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 24, 2025
Merged

More accurate spotless config #4499

merged 3 commits into from
Jun 24, 2025

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Jun 18, 2025

📜 Description

This PR ensures that spotless is actually running over all our files. It
wasn't before and you can see this generated a massive diff.
There are still a number of exceptions that were suppressed in order to
save time going through the hundreds of them.

In other news, this moves the spotless logic to its own convention
plugin and runs over each source set of each project separately. This
means that most of the tasks should be cached independently.

This switches our formatter to ktfmt and 2 space indents to match the SAGP codebase.

#skip-changelog

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Jun 18, 2025

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/RateLimiter.java

Copy link
Contributor Author

@runningcode runningcode left a comment

Choose a reason for hiding this comment

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

99% of this PR is just autoformatting. 😢

id("com.diffplug.spotless")
}

spotless {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new logic.

targetExclude("src/test/java/io/sentry/apollo4/generated/**", "src/test/java/io/sentry/apollo3/adapter/**")
suppressLintsFor {
step = "ktlint"
shortCode = "standard:max-line-length"
Copy link
Contributor Author

@runningcode runningcode Jun 18, 2025

Choose a reason for hiding this comment

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

max-line-length, property-naming and function-naming had hundreds of violations that aren’t auto-fixable and would have made this PR even larger so i just supressed them for now.

@runningcode runningcode changed the title More accurate, faster spotless config More accurate spotless config Jun 18, 2025
Copy link
Contributor

github-actions bot commented Jun 18, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 409.57 ms 450.60 ms 41.03 ms
Size 1.58 MiB 2.09 MiB 518.81 KiB

Previous results on branch: no/spotless

Startup times

Revision Plain With Sentry Diff
266364c 387.39 ms 420.94 ms 33.55 ms
6c80c41 453.08 ms 472.14 ms 19.06 ms
3aa20d2 429.21 ms 513.43 ms 84.21 ms

App size

Revision Plain With Sentry Diff
266364c 1.58 MiB 2.09 MiB 518.66 KiB
6c80c41 1.58 MiB 2.09 MiB 518.71 KiB
3aa20d2 1.58 MiB 2.09 MiB 518.66 KiB

Copy link
Contributor

github-actions bot commented Jun 19, 2025

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/RateLimiter.java

Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

I suggest adding this to .git-blame-ignore-revs

Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/RateLimiter.java

Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/RateLimiter.java

runningcode and others added 3 commits June 24, 2025 08:42
This PR ensures that spotless is actually running over all our files. It
wasn't before and you can see this generated a massive diff.
There are still a number of exceptions that were suppressed in order to
save time going through the hundreds of them.

In other news, this moves the spotless logic to its own convention
plugin and runs over each source set of each project separately. This
means that most of the tasks should be cached independently.
Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/RateLimiter.java

@runningcode runningcode enabled auto-merge (squash) June 24, 2025 06:52
@runningcode runningcode merged commit 8b8369f into main Jun 24, 2025
34 checks passed
@runningcode runningcode deleted the no/spotless branch June 24, 2025 07:01
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.

4 participants