Skip to content

Commit

Permalink
chore: ignore specific lines and bump up coverage (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsgalarraga authored Mar 15, 2024
1 parent 9b41228 commit bcfe5b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
min_coverage: 97

spell-check:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1
Expand Down
19 changes: 11 additions & 8 deletions lib/crossword/game/components/section_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ class SectionTapController extends PositionComponent
);

for (final word in [...boardSection.words, ...boardSection.borderWords]) {
final wordLength =
(word.answer.length * CrosswordGame.cellSize).toDouble();
final wordLength = word.answer.length * CrosswordGame.cellSize;
final width =
word.axis == Axis.horizontal ? wordLength : CrosswordGame.cellSize;
final height =
word.axis == Axis.vertical ? wordLength : CrosswordGame.cellSize;

final wordRect = Rect.fromLTWH(
(word.position.x * CrosswordGame.cellSize).toDouble(),
(word.position.y * CrosswordGame.cellSize).toDouble(),
word.axis == Axis.horizontal
? wordLength
: CrosswordGame.cellSize.toDouble(),
word.axis == Axis.vertical
? wordLength
: CrosswordGame.cellSize.toDouble(),
width.toDouble(),
height.toDouble(),
);

if (wordRect.contains(localPosition.toOffset())) {
Expand Down Expand Up @@ -252,6 +252,8 @@ class SectionComponent extends Component with HasGameRef<CrosswordGame> {
for (var c = 0; c < wordCharacters.length; c++) {
late Rect rect;
if (word.solvedTimestamp != null) {
// A bug in coverage is preventing this block from being covered
// coverage:ignore-start
final char = wordCharacters.elementAt(c);
final charIndex = char.codeUnitAt(0) - 65;
rect = Rect.fromLTWH(
Expand All @@ -260,6 +262,7 @@ class SectionComponent extends Component with HasGameRef<CrosswordGame> {
CrosswordGame.cellSize.toDouble(),
CrosswordGame.cellSize.toDouble(),
);
// coverage:ignore-end
} else {
rect = Rect.fromLTWH(
2080,
Expand Down

0 comments on commit bcfe5b3

Please sign in to comment.