Skip to content

Commit

Permalink
fix: Fix code cov script to skip part of files.
Browse files Browse the repository at this point in the history
  • Loading branch information
wizlif committed Oct 10, 2022
1 parent a46d7e8 commit 2404d6f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/scripts/coverage_gen.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/sh
file=test/coverage_helper_test.dart
touch file
echo "// Helper file to make coverage report for all dart files\n" >> $file
echo "// ignore_for_file: unused_import" >> $file
find lib -type f \( -iname "*.dart" ! -iname "*.g.dart" ! -iname "*.gr.dart" ! -iname "*.freezed.dart" ! -iname "generated_plugin_registrant.dart" ! -iname "*_state.dart" ! -iname "*_event.dart" \) | cut -c 4- | sort | awk -v package="$1" '{printf "import '\''package:collaction_app%s%s'\'';\n", package, $1}' >> $file
echo "void main(){}" >> $file

{
printf "// Helper file to make coverage report for all dart files\n"
echo "// ignore_for_file: unused_import"
find lib -type f \( -iname "*.dart" ! -iname "*.g.dart" ! -iname "*.gr.dart" ! -iname "*.freezed.dart" ! -iname "generated_plugin_registrant.dart" ! -iname "*_state.dart" ! -iname "*_event.dart" \) -print0 | xargs -0 grep -L "^part of" | cut -c 4- | sort | awk -v package="$1" '{printf "import '\''package:collaction_app%s%s'\'';\n", package, $1}'
echo "void main(){}"
} >>$file
2 changes: 1 addition & 1 deletion lib/presentation/core/routes/app_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part 'package:collaction_app/presentation/core/routes/app_page.ext.dart';
part 'app_page.ext.dart';

enum AppPage {
mainPage,
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/core/routes/app_page.ext.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of 'package:collaction_app/presentation/core/routes/app_page.dart';
part of 'app_page.dart';

extension AppPageExt on AppPage {
// Route paths
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:go_router/go_router.dart';
import '../core/collaction_icons.dart';
import '../themes/constants.dart';

part 'package:collaction_app/presentation/home/widgets/home_nav.dart';
part 'widgets/home_nav.dart';

class HomePage extends StatelessWidget {
// Current display page
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/home/widgets/home_nav.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of 'package:collaction_app/presentation/home/home_screen.dart';
part of '../home_screen.dart';

/// Home page navigation bar
Widget bottomNavbar(BuildContext context) {
Expand Down

0 comments on commit 2404d6f

Please sign in to comment.