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

ci: Update workflow to include custom lint #325

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
8 changes: 6 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ jobs:

- run: flutter analyze --write=flutter_analyze.log

- uses: yorifuji/flutter-analyze-commenter@v1
- if: ${{ !cancelled() }}
run: dart run custom_lint --format=json > custom_lint.json

- uses: yorifuji/flutter-analyze-commenter@develop
if: ${{ !cancelled() }}
with:
analyze_log: flutter_analyze.log
analyze-log: flutter_analyze.log
custom-lint-log: custom_lint.json
verbose: true

# diff:
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/strings.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions lib/store/recipe_store2.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:buzz_recipe_viewer/model/recipe.dart';
import 'package:buzz_recipe_viewer/store/favorite_store.dart';
import 'package:buzz_recipe_viewer/store/search_hit_store.dart';
import 'package:collection/collection.dart';
import 'package:mockito/mockito.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'recipe_store2.g.dart';

@riverpod
Copy link
Contributor

@github-actions github-actions bot Dec 22, 2023

Choose a reason for hiding this comment

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

LevelMessage
ℹ️ If a provider depends on providers which specify "dependencies", they should themselves specify "dependencies" and include all the scoped providers.
Level Message
ℹ️ If a provider depends on providers which specify "dependencies", they should themselves specify "dependencies" and include all the scoped providers.

class RecipeStore2 extends _$RecipeStore2 {
@override
List<Recipe> build() {
final searchHitList = ref.watch(searchHitStoreProvider);
final favoriteList = ref.watch(favoriteStoreProvider);

if (favoriteList.isEmpty) {
return searchHitList.map((e) => Recipe(searchHit: e)).toList();
} else {
return searchHitList.map((searchHit) {
final favorite = favoriteList.firstWhereOrNull(
(favorite) => favorite.searchHitId == searchHit.id,
);
return Recipe(
searchHit: searchHit,
favorite: favorite,
);
}).toList();
}
}
}

class FakeRecipeStore extends _$RecipeStore with Mock implements RecipeStore2 {
@override
List<Recipe> build() => [];
}
27 changes: 27 additions & 0 deletions lib/store/recipe_store2.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading