You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Stefan Miklosovic (Jira)" <ji...@apache.org> on 2023/09/18 20:45:00 UTC

[jira] [Comment Edited] (CASSANDRA-18865) Enable unnecessary import from the same package check (RedundantImportCheck)

    [ https://issues.apache.org/jira/browse/CASSANDRA-18865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766579#comment-17766579 ] 

Stefan Miklosovic edited comment on CASSANDRA-18865 at 9/18/23 8:44 PM:
------------------------------------------------------------------------

This is very interesting. I was expecting there will be a lot of violations. Does that rule indeed works? :) Hard to believe ...

Besides that, I am wondering if we really want to do this. The only argument against that is that somebody can easily "grep" where a class is used across the whole project just grepping imports but since IDEs are doing this automatically I do not think we need to "support" this (and it would not be even very precise as there might be already cases when it is not imported and that class is used in another one anyway, without any import, because it is in the same package). That is all being said if we actually had cases like that over the code-base but you say we do not which makes that argument somehow void.


was (Author: smiklosovic):
This is very interesting. I was expecting there will be a lot of violations. Does that rule indeed works? :) Hard to believe ...

Besides that, I am wondering if we really want to do this. The only argument against that is that somebody can easily "grep" where a class is used across the whole project just grepping imports but since IDEs are doing this automatically I do not think we need to "support" this (and it would be even very precise as there might be already cases when it is not imported and that class is used in another one anyway, without any import, because it is in the same package). That is all being said if we actually had cases like that over the code-base but you say we do not which makes that argument somehow void.

> Enable unnecessary import from the same package check (RedundantImportCheck)
> ----------------------------------------------------------------------------
>
>                 Key: CASSANDRA-18865
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18865
>             Project: Cassandra
>          Issue Type: Task
>            Reporter: Maxim Muzafarov
>            Assignee: Maxim Muzafarov
>            Priority: Normal
>         Attachments: image-2023-09-18-10-19-15-531.png
>
>
> Currently, the unnecessary imports are enabled by the code style and are not displayed by the IDE with the configuration stored in the project root. See the screenshot below. The RedundantImportCheck is not enabled by the checkstyle. 
> It seems the following needs to be done:
> - enable this check in the IDE configuration for all supported IDEs;
> - enable check in the checkstyle plugin;
> - update the documentation;



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org