Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new bloc_related_class_naming lint to enforce naming conventions for Bloc/Cubit-related types (Event/State/Presentation Event), building on the bloc-architecture lint set introduced in #458.
Changes:
- Introduce
BlocRelatedClassNaminglint that inspects Bloc/Cubit generic type arguments (andBlocPresentationMixinusage). - Add shared bloc inspection helpers (
bloc_utils.dart) to identify bloc/cubit types and extract relevant type annotations. - Add test coverage and test-only mock libraries (including
bloc_presentation), register the lint in the plugin, and document it in the README.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/leancode_lint/lib/src/lints/bloc_related_class_naming.dart | Implements the new lint and reporting logic for related class naming. |
| packages/leancode_lint/lib/src/bloc_utils.dart | Adds shared utilities for detecting bloc/cubit classes and extracting event/state/presentation-event types. |
| packages/leancode_lint/lib/plugin.dart | Registers the new lint in the plugin. |
| packages/leancode_lint/README.md | Documents the new lint and its naming rules. |
| packages/leancode_lint/test/test_cases/bloc_related_class_naming_test.dart | Adds tests verifying diagnostics for bloc/cubit naming and external-library ignore behavior. |
| packages/leancode_lint/test/mock_libraries/bloc.dart | Extends the bloc mock to include BlocBase and Bloc, enabling bloc tests. |
| packages/leancode_lint/test/mock_libraries/bloc_presentation.dart | Adds a mock bloc_presentation package with BlocPresentationMixin. |
| packages/leancode_lint/test/mock_libraries.dart | Wires the new bloc_presentation mock into the test harness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of #458