Skip to content
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

property-naming flags extension properties #2024

Closed
vanniktech opened this issue May 12, 2023 · 3 comments · Fixed by #2026
Closed

property-naming flags extension properties #2024

vanniktech opened this issue May 12, 2023 · 3 comments · Fixed by #2026
Milestone

Comments

@vanniktech
Copy link
Contributor

The following code gets flagged with 0.49.1:

val Context.adsDelegateFactory @SuppressLint("WrongConstant") get() =
  applicationContext.getSystemService(SYSTEM_SERVICE_AD_DELEGATE_FACTORY) as AdsDelegateFactory

Property name should use the screaming snake case notation when the value can not be changed (standard:property-naming)

I would not expect this, if you're adding a property via an extension and leveraging get() since the value can indeed change inside the implementation.

@vanniktech
Copy link
Contributor Author

So when I remove @SuppressLint("WrongConstant") it does not get flagged as expected. So there's something weird going on.

@paul-dingemans
Copy link
Collaborator

Indeed, the annotation causes the check to fail. Same happens with:

val Context.adsDelegateFactory private get() =
    applicationContext.getSystemService(SYSTEM_SERVICE_AD_DELEGATE_FACTORY) as AdsDelegateFactory

@paul-dingemans paul-dingemans added this to the 0.49.2 milestone May 14, 2023
@paul-dingemans
Copy link
Collaborator

Problem will either be resolved in 0.49.2 only when more pressing bugs need to be fixed. Otherwise it will be fixed in the next normal release.

paul-dingemans added a commit that referenced this issue May 14, 2023
…er is annotated or prefixed with a modifier

Closes #2024
paul-dingemans added a commit that referenced this issue May 15, 2023
…er is annotated or prefixed with a modifier (#2026)

Closes #2024
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 a pull request may close this issue.

2 participants