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

Support ignoreAnnotated in ArrayPrimitive rule #4853

Closed
ZacSweers opened this issue May 22, 2022 · 3 comments · Fixed by SchemaStore/schemastore#2623
Closed

Support ignoreAnnotated in ArrayPrimitive rule #4853

ZacSweers opened this issue May 22, 2022 · 3 comments · Fixed by SchemaStore/schemastore#2623

Comments

@ZacSweers
Copy link
Contributor

The rule or changes you're looking for might have already been suggested!
Please search in the issues before creating a new one.

Expected Behavior of the rule

Currently the rule always requires suppression, but there are some annotation-based scenarios where boxed type arrays must be used, such as in Junit 4's @Parameterized.Parameters-annotated functions.

Context

It would be helpful to be able to suppress functions annotated as such to avoid these false positives.

@cortinico
Copy link
Member

You should be able to use ignoreAnnotated on any rule so it should work with ArrayPrimitive as well: https://detekt.dev/docs/introduction/suppressors/#annotation-suppressor

@ZacSweers
Copy link
Contributor Author

Thanks, I didn't realize that. It's not documented in detekt's schema here: https://json.schemastore.org/detekt.json (which is what Studio/IJ indexes)

image

@cortinico
Copy link
Member

It's not documented in detekt's schema here: json.schemastore.org/detekt.json (which is what Studio/IJ indexes)

yup you're right. The problem is that this schemastore is community maintained and hasn't been updated since 2020: https://github.com/SchemaStore/schemastore/commits/master/src/schemas/json/detekt.json

We should look into doing:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants