Skip to content

Add the bloc_related_class_naming lint#504

Open
PiotrRogulski wants to merge 3 commits intomasterfrom
bloc-related-class-naming-lint
Open

Add the bloc_related_class_naming lint#504
PiotrRogulski wants to merge 3 commits intomasterfrom
bloc-related-class-naming-lint

Conversation

@PiotrRogulski
Copy link
Member

Continuation of #458

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 BlocRelatedClassNaming lint that inspects Bloc/Cubit generic type arguments (and BlocPresentationMixin usage).
  • 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.

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

Labels

p: leancode_lint Related to the leancode_lint package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant