feat: add cspell (#399)

* feat: add cspell

* revert main and add spell check as a different flow

* check all files

* all files again

* another regex

* dart files

* more changes

* actually checkout the repo

* adding words

* more words

* more words and starting to change code

* more words

* more words

* more words

* more words

* more words

* fixing words

* fixing words

* adding and fixing

* fixes and words

* word fixes

* fixes and words
pull/401/head
Tom Arra 2 years ago committed by GitHub
parent 6aef28ed8c
commit ce39bc1471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,3 +14,4 @@ jobs:
flutter_version: 2.10.5
coverage_excludes: "lib/gen/*.dart"
test_optimization: false

@ -0,0 +1,21 @@
name: spell_check
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [pull_request]
jobs:
build:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check spelling
uses: zwaldowski/cspell-action@v1
with:
paths: '**/*.{dart,arb}'
config: .vscode/cspell.json

@ -0,0 +1,41 @@
{
"version": "0.2",
"enabled": true,
"language": "en",
"words": [
"animatronic",
"argb",
"audioplayers",
"backbox",
"bezier",
"cupertino",
"dashbook",
"deserialization",
"dpad",
"endtemplate",
"firestore",
"gapless",
"goldens",
"leaderboard",
"loadables",
"mixins",
"mocktail",
"multiball",
"multiballs",
"occluder",
"pixelated",
"pixeloid",
"rects",
"rrect",
"serializable",
"sparky's",
"theming",
"unawaited",
"unfocus",
"unlayered",
"vsync"
],
"ignorePaths": [
".github/workflows/**"
]
}

@ -15,7 +15,7 @@ import 'package:pinball_flame/pinball_flame.dart';
/// {@endtemplate}
class ScoringBehavior extends Component
with HasGameRef, FlameBlocReader<GameBloc, GameState> {
/// {@macto scoring_behavior}
/// {@macro scoring_behavior}
ScoringBehavior({
required Points points,
required Vector2 position,

@ -77,7 +77,7 @@ class InitialsInputDisplay extends Component with HasGameRef {
);
}
/// Returns the current inputed initials
/// Returns the current entered initials
String get initials => children
.whereType<InitialsLetterPrompt>()
.map((prompt) => prompt.char)

@ -143,7 +143,7 @@ class PinballGame extends PinballForge2DGame
final rocket = descendants().whereType<RocketSpriteComponent>().first;
final bounds = rocket.topLeftPosition & rocket.size;
// NOTE(wolfen): As long as Flame does not have https://github.com/flame-engine/flame/issues/1586 we need to check it at the highest level manually.
// NOTE: As long as Flame does not have https://github.com/flame-engine/flame/issues/1586 we need to check it at the highest level manually.
if (bounds.contains(info.eventPosition.game.toOffset())) {
descendants().whereType<Plunger>().single.pullFor(2);
} else {

@ -244,7 +244,7 @@ class PinballAudioPlayer {
return audios.values.map((a) => a.load()).toList();
}
/// Plays the received auido
/// Plays the received audio
void play(PinballAudio audio) {
assert(
audios.containsKey(audio),

@ -68,7 +68,7 @@ class Ball extends BodyComponent with Layered, InitialPosition, ZIndex {
return world.createBody(bodyDef)..createFixtureFromShape(shape, 1);
}
/// Immediatly and completly [stop]s the ball.
/// Immediately and completely [stop]s the ball.
///
/// The [Ball] will no longer be affected by any forces, including it's
/// weight and those emitted from collisions.

@ -12,7 +12,7 @@ class BumpingBehavior extends ContactBehavior {
/// Determines how strong the bump is.
final double _strength;
/// This is used to recoginze the current state of a contact manifold in world
/// This is used to recognize the current state of a contact manifold in world
/// coordinates.
@visibleForTesting
final WorldManifold worldManifold = WorldManifold();

@ -40,7 +40,7 @@ class _FlipperAnchor extends JointAnchor {
}
/// {@template flipper_anchor_revolute_joint_def}
/// Hinges one end of [Flipper] to a [_FlipperAnchor] to achieve a potivoting
/// Hinges one end of [Flipper] to a [_FlipperAnchor] to achieve a pivoting
/// motion.
/// {@endtemplate}
class _FlipperAnchorRevoluteJointDef extends RevoluteJointDef {

@ -12,7 +12,7 @@ import 'package:pinball_components/pinball_components.dart';
/// initialize(
/// dynamicBody.body,
/// anchor.body,
/// dynabmicBody.body + anchor.body.position,
/// dynamicBody.body + anchor.body.position,
/// );
/// ```
/// {@endtemplate}

@ -6,7 +6,7 @@ import 'package:pinball_flame/pinball_flame.dart';
/// {@template plunger}
/// [Plunger] serves as a spring, that shoots the ball on the right side of the
/// playfield.
/// play field.
///
/// [Plunger] ignores gravity so the player controls its downward [pull].
/// {@endtemplate}

@ -37,7 +37,7 @@ class Slingshot extends BodyComponent with InitialPosition {
}) : _angle = angle,
super(
children: [
_SlinghsotSpriteComponent(spritePath, angle: angle),
_SlingshotSpriteComponent(spritePath, angle: angle),
BumpingBehavior(strength: 20),
],
renderBody: false,
@ -90,8 +90,8 @@ class Slingshot extends BodyComponent with InitialPosition {
}
}
class _SlinghsotSpriteComponent extends SpriteComponent with HasGameRef {
_SlinghsotSpriteComponent(
class _SlingshotSpriteComponent extends SpriteComponent with HasGameRef {
_SlingshotSpriteComponent(
String path, {
required double angle,
}) : _path = path,

@ -32,7 +32,7 @@ void main() {
});
flameTester.testGameWidget(
'the bump is greater when the strengh is greater',
'the bump is greater when the strength is greater',
setUp: (game, tester) async {
final component1 = _TestBodyComponent();
final behavior1 = BumpingBehavior(strength: 1)

@ -67,7 +67,7 @@ void main() {
},
);
flameTester.test('adds a FlapperSpiningBehavior to FlapperEntrance',
flameTester.test('adds a FlapperSpinningBehavior to FlapperEntrance',
(game) async {
final flapper = Flapper();
await game.ensureAdd(flapper);

@ -54,7 +54,7 @@ void main() {
);
flameTester.test(
'deafaults to zero '
'defaults to zero '
'when no initialPosition is given',
(game) async {
final component = TestBodyComponent();

@ -329,7 +329,7 @@ void main() {
);
flameTester.test(
'connected body collison enabled',
'connected body collision enabled',
(game) async {
await game.ensureAdd(plunger);
await game.ensureAdd(anchor);

@ -12,7 +12,7 @@ typedef PaintFunction = void Function(Paint);
/// {@template canvas_component}
/// Allows listening before the rendering of [Sprite]s.
///
/// The existance of this class is to hack around the fact that Flame doesn't
/// The existence of this class is to hack around the fact that Flame doesn't
/// provide a global way to modify the default [Paint] before rendering a
/// [Sprite].
/// {@endtemplate}

@ -4,7 +4,7 @@ import 'package:flame/game.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_forge2d/world_contact_listener.dart';
// NOTE(wolfen): This should be removed when https://github.com/flame-engine/flame/pull/1597 is solved.
// NOTE: This should be removed when https://github.com/flame-engine/flame/pull/1597 is solved.
/// {@template pinball_forge2d_game}
/// A [Game] that uses the Forge2D physics engine.
/// {@endtemplate}

@ -50,7 +50,7 @@ void main() {
);
flameTester.testGameWidget(
'calls onSpritePainted when paiting a sprite',
'calls onSpritePainted when painting a sprite',
setUp: (game, tester) async {
final spriteComponent = _TestSpriteComponent();

@ -38,9 +38,9 @@ void main() {
final component = Component();
final controller = TestComponentController(component);
final anotherComponet = Component();
final anotherComponent = Component();
await expectLater(
() async => await anotherComponet.add(controller),
() async => await anotherComponent.add(controller),
throwsAssertionError,
);
},

@ -19,7 +19,7 @@ void main() {
});
flameTester.test(
'screenToFlameWorld throws UnimpelementedError',
'screenToFlameWorld throws UnimplementedError',
(game) async {
expect(
() => game.screenToFlameWorld(Vector2.zero()),
@ -29,7 +29,7 @@ void main() {
);
flameTester.test(
'screenToWorld throws UnimpelementedError',
'screenToWorld throws UnimplementedError',
(game) async {
expect(
() => game.screenToWorld(Vector2.zero()),
@ -39,7 +39,7 @@ void main() {
);
flameTester.test(
'worldToScreen throws UnimpelementedError',
'worldToScreen throws UnimplementedError',
(game) async {
expect(
() => game.worldToScreen(Vector2.zero()),

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
/// {@tempalte animated_ellipsis_text}
/// {@template animated_ellipsis_text}
/// Every 500 milliseconds, it will add a new `.` at the end of the given
/// [text]. Once 3 `.` have been added (e.g. `Loading...`), it will reset to
/// zero ellipsis and start over again.

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:pinball_ui/pinball_ui.dart';
/// {@template crt_background}
/// [BoxDecoration] that provides a CRT-like background efffect.
/// [BoxDecoration] that provides a CRT-like background effect.
/// {@endtemplate}
class CrtBackground extends BoxDecoration {
/// {@macro crt_background}

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:pinball_ui/gen/gen.dart';
import 'package:pinball_ui/pinball_ui.dart';
/// Enum with all possibile directions of a [PinballDpadButton].
/// Enum with all possible directions of a [PinballDpadButton].
enum PinballDpadDirection {
/// Up
up,

@ -27,7 +27,7 @@ void main() {
});
test(
'returns false when defaultTargetPlatform is niether iOS nor android',
'returns false when defaultTargetPlatform is neither iOS nor android',
() async {
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
expect(PlatformHelper().isMobile, isFalse);

@ -129,7 +129,7 @@ void main() {
},
);
String? submitedInitials;
String? submittedInitials;
flameTester.testGameWidget(
'submits the initials',
setUp: (game, tester) async {
@ -138,7 +138,7 @@ void main() {
score: 1000,
characterIconPath: game.characterIconPath,
onSubmit: (value) {
submitedInitials = value;
submittedInitials = value;
},
);
await game.pump(component);
@ -147,7 +147,7 @@ void main() {
await tester.pump();
},
verify: (game, tester) async {
expect(submitedInitials, equals('AAA'));
expect(submittedInitials, equals('AAA'));
},
);

@ -95,9 +95,9 @@ void main() {
),
);
final basebottomGroups =
final baseBottomGroups =
bottomGroup.descendants().whereType<Baseboard>();
expect(basebottomGroups.length, equals(2));
expect(baseBottomGroups.length, equals(2));
},
);

@ -162,7 +162,7 @@ void main() {
);
flameTester.test(
'removes FlipperKeyControllingBehavior from Fipper',
'removes FlipperKeyControllingBehavior from Flipper',
(game) async {
final component = GameBlocStatusListener();
final repository = _MockLeaderboardRepository();
@ -242,7 +242,7 @@ void main() {
);
flameTester.test(
'adds key controlling behavior to Fippers when the game is started',
'adds key controlling behavior to Flippers when the game is started',
(game) async {
final component = GameBlocStatusListener();
final repository = _MockLeaderboardRepository();

@ -14,7 +14,7 @@ void main() {
});
blocTest<CharacterThemeCubit, CharacterThemeState>(
'charcterSelected emits selected character theme',
'characterSelected emits selected character theme',
build: CharacterThemeCubit.new,
act: (bloc) => bloc.characterSelected(const SparkyTheme()),
expect: () => [

Loading…
Cancel
Save