Check scope of the function call #2926
Replies: 1 comment 3 replies
-
It doesn't look like something that ktlint can (nor should) support out of the box as the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello team,
is it possible to check if a function call is inside a specific scope?
For example, let's say I want to invoke API calls only inside a helper function. One way to force this would be by context receivers, but these are deprecated, context parameters are not available yet, and this will require having context definition on every API method. With context receivers it would look like:
Would it be possible to check by ktlint if the call is in the
ApiCallScope
scope? Without the usage of context receivers?Another way would be make all API methods extension functions on
ApiCallScope
, but it would require thisrun
/apply
construct which I would like to avoid.Beta Was this translation helpful? Give feedback.
All reactions