Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: CI for PRs

on:
pull_request:
paths-ignore:
- "**.md"
paths:
- "**/yx_scope/**"
- "**/.github/**"
- "!**.md"
branches:
- main

Expand All @@ -17,9 +19,9 @@ jobs:
# Check the library against the most recent version and the previous minor version
flutter-version: [3.32.4, 3.29.2, 3.27.1, 3.24.5]
package:
- packages/yx_scope
- packages/yx_scope_flutter
- packages/yx_scope_linter
- yx_scope/packages/yx_scope
- yx_scope/packages/yx_scope_flutter
- yx_scope/packages/yx_scope_linter

defaults:
run:
Expand All @@ -45,9 +47,9 @@ jobs:
run: flutter analyze

- name: Verify custom_lint
working-directory: packages/yx_scope_linter/example
working-directory: yx_scope/packages/yx_scope_linter/example
run: dart run custom_lint --watch

- name: Run tests
if: matrix.package != 'packages/yx_scope_linter'
if: matrix.package != 'yx_scope/packages/yx_scope_linter'
run: flutter test
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class ResolvedYXScopeResult {
/// from [element]
ClassDeclaration? classDeclarationByElement(Element element) {
for (final unit in units) {
final declaration = unit.declarations
final declarations = unit.declarations
.where((declaration) => declaration.declaredElement == element)
.whereType<ClassDeclaration>()
.firstOrNull;
if (declaration != null) {
return declaration;
.whereType<ClassDeclaration>();
if (declarations.isEmpty) {
return null;
}
return declarations.first;
}
return null;
}
Expand Down