Skip to content

Split detekt safe calls into two files#3572

Merged
jonathanmos merged 2 commits into
developfrom
jmoskovich/split-custom-detekt
Jun 24, 2026
Merged

Split detekt safe calls into two files#3572
jonathanmos merged 2 commits into
developfrom
jmoskovich/split-custom-detekt

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Jun 24, 2026

Copy link
Copy Markdown
Member

What does this PR do?

detekt_custom_safe_calls.yml had grown large enough to hit SnakeYAML's parsing limits, causing CI to fail. This PR splits it into two files to bring each under the limit:

detekt_custom_safe_calls_android.yml — Android platform APIs (android., androidx., Google Material)
detekt_custom_safe_calls_third_party.yml — Third-party and stdlib entries (OkHttp, Gson, Apollo, Cronet, Glide, Kotlin stdlib, Java stdlib, RxJava, etc.)
To support this, the UnsafeThirdPartyFunctionCall rule now reads two distinct config keys (knownSafeAndroidCalls and knownSafeThirdPartyCalls) instead of a single knownSafeCalls list. This mirrors the existing pattern used for knownThrowingCalls / knownSafeCalls across separate files, avoiding any YAML merge issues when passing multiple config files to detekt.

Two pre-existing bugs in DetektCustomConfig are also fixed as part of this change:

detekt_classpath was read at Gradle configuration time, causing "Could not create task" failures on clean checkouts; it is now read in doFirst
customDetektRules had no dependsOn("printDetektClasspath"), so detekt_classpath could be missing at execution time

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@codecov-commenter

codecov-commenter commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.50%. Comparing base (2248829) to head (f3361f9).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3572      +/-   ##
===========================================
- Coverage    72.53%   72.50%   -0.03%     
===========================================
  Files          978      978              
  Lines        36058    36065       +7     
  Branches      6041     6039       -2     
===========================================
- Hits         26152    26148       -4     
- Misses        8234     8250      +16     
+ Partials      1672     1667       -5     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos marked this pull request as ready for review June 24, 2026 12:58
@jonathanmos
jonathanmos requested review from a team as code owners June 24, 2026 12:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e33293377

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jonathanmos
jonathanmos force-pushed the jmoskovich/split-custom-detekt branch from 3e33293 to f5ee77d Compare June 24, 2026 13:06
kikoveiga
kikoveiga previously approved these changes Jun 24, 2026
Comment thread detekt_custom_safe_calls_android.yml Outdated
abrooksv
abrooksv previously approved these changes Jun 24, 2026
kikoveiga
kikoveiga previously approved these changes Jun 24, 2026
hamorillo
hamorillo previously approved these changes Jun 24, 2026
@jonathanmos
jonathanmos dismissed stale reviews from hamorillo, kikoveiga, and abrooksv via f3361f9 June 24, 2026 14:43
@jonathanmos
jonathanmos force-pushed the jmoskovich/split-custom-detekt branch from b68fa2b to f3361f9 Compare June 24, 2026 14:43
@jonathanmos
jonathanmos merged commit 456ca2c into develop Jun 24, 2026
27 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/split-custom-detekt branch June 24, 2026 16:15
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.

5 participants