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

Issue #3544: cleaned API methods related to MessageDispatcher & Renamed to ViolationDispatcher #14687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MANISH-K-07
Copy link
Contributor

Part of #3544

Renamed MessageDispatcher --> ViolationDispatcher
Cleaned up all related methods.

@MANISH-K-07 MANISH-K-07 marked this pull request as ready for review March 19, 2024 13:06
import com.puppycrawl.tools.checkstyle.api.RootModule;
import com.puppycrawl.tools.checkstyle.api.SeverityLevel;
import com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter;
import com.puppycrawl.tools.checkstyle.api.Violation;
import com.puppycrawl.tools.checkstyle.api.ViolationDispatcher;
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering this interface seats in the api package, should we go via deprecation process first, so we introduce a new interface but still keep the old one marked as deprecated? Otherwise, this PR may contain breaking changes. @romani what are your thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we need to think on deprecation first. To let all plugins to migrate first, and if no known tools left, do deletion.
Is it possible?

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

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

Items

@@ -24,7 +24,7 @@
/**
* Used by FileSetChecks to distribute AuditEvents to AuditListeners.
*/
public interface MessageDispatcher {
public interface ViolationDispatcher {
Copy link
Member

Choose a reason for hiding this comment

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

This by fact, new class.
This good opportunity to make it with better design.

Major concerns on void fireErrors(String fileName, SortedSet<Violation> errors);
Name of method is not good. Should be fireViolations or similar.

@rdiachenko , what would you recommend?
We can change all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rdiachenko , ping please

Copy link
Member

Choose a reason for hiding this comment

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

public interface ViolationDispatcher{
  void fireFileStarted(String fileName);
  void fireFileFinished(String fileName);
  void fireErrors(String fileName, SortedSet<Violation> errors);
}

Name of class and method becomes weird. Before update it was also not good, but it was too abstract it was less a concern, MessageDispatcher.

Problem is that we mixing fireFileXxxx with fireViolation and call it ViolationDispatrer, that is good name if only fireViolation be in interface.

May be we should just rename method in this interface to fireViolation and name of class EventDispatcher. Do we have any EventXxxx in our code base?

Copy link
Member

@romani romani Apr 6, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can not use Event word.

@romani , this PR is already outdated by 2 weeks. So, how do you suggest we finish this?

Copy link
Member

@romani romani Apr 7, 2024

Choose a reason for hiding this comment

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

@rdiachenko , is there any suggestion on api naming and structure ?
@nrmancuso , @rnveach , please share your opinion.

Copy link
Member

@rnveach rnveach Apr 7, 2024

Choose a reason for hiding this comment

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

I think we first need confirmation we are breaking compatibility with this issue and PR. We are renaming an interface that sits in the API class. I am also not seeing any deprecation in this PR as issue states.

If we are breaking compatibility, then issues needs label.

Copy link
Member

@romani romani Apr 8, 2024

Choose a reason for hiding this comment

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

we put labels after a fix, if we agree on fix, label is just reflection.
I am ok to break compatibility if we got better api that is easier to understand. For now I do not see that we improving.

Copy link
Member

Choose a reason for hiding this comment

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

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.

None yet

5 participants