From ce39bc147188ad14ae874358bc4a424d1aaa714b Mon Sep 17 00:00:00 2001 From: Tom Arra Date: Sat, 7 May 2022 17:25:20 -0500 Subject: [PATCH] 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 --- .github/workflows/main.yaml | 1 + .github/workflows/spell_check.yaml | 21 ++++++++++ .vscode/cspell.json | 41 +++++++++++++++++++ lib/game/behaviors/scoring_behavior.dart | 2 +- .../displays/initials_input_display.dart | 2 +- lib/game/pinball_game.dart | 2 +- .../pinball_audio/lib/src/pinball_audio.dart | 2 +- .../lib/src/components/ball/ball.dart | 2 +- .../lib/src/components/bumping_behavior.dart | 2 +- .../behaviors/flipper_jointing_behavior.dart | 2 +- .../lib/src/components/joint_anchor.dart | 2 +- .../lib/src/components/plunger.dart | 2 +- .../lib/src/components/slingshot.dart | 6 +-- .../src/components/bumping_behavior_test.dart | 2 +- .../src/components/flapper/flapper_test.dart | 2 +- .../src/components/initial_position_test.dart | 2 +- .../test/src/components/plunger_test.dart | 2 +- .../lib/src/canvas/canvas_component.dart | 2 +- .../lib/src/pinball_forge2d_game.dart | 2 +- .../src/canvas/canvas_component_test.dart | 2 +- .../test/src/component_controller_test.dart | 4 +- .../test/src/pinball_forge2d_game_test.dart | 6 +-- .../src/widgets/animated_ellipsis_text.dart | 2 +- .../lib/src/widgets/crt_background.dart | 2 +- .../lib/src/widgets/pinball_dpad_button.dart | 2 +- .../test/src/platform_helper_test.dart | 2 +- .../displays/initials_input_display_test.dart | 6 +-- test/game/components/bottom_group_test.dart | 4 +- .../game_bloc_status_listener_test.dart | 4 +- .../cubit/character_theme_cubit_test.dart | 2 +- 30 files changed, 99 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/spell_check.yaml create mode 100644 .vscode/cspell.json diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5bef442d..48ad112c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,3 +14,4 @@ jobs: flutter_version: 2.10.5 coverage_excludes: "lib/gen/*.dart" test_optimization: false + diff --git a/.github/workflows/spell_check.yaml b/.github/workflows/spell_check.yaml new file mode 100644 index 00000000..61b142b7 --- /dev/null +++ b/.github/workflows/spell_check.yaml @@ -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 \ No newline at end of file diff --git a/.vscode/cspell.json b/.vscode/cspell.json new file mode 100644 index 00000000..d07b61c2 --- /dev/null +++ b/.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/**" + ] +} diff --git a/lib/game/behaviors/scoring_behavior.dart b/lib/game/behaviors/scoring_behavior.dart index 8b403d1e..4d6d8b42 100644 --- a/lib/game/behaviors/scoring_behavior.dart +++ b/lib/game/behaviors/scoring_behavior.dart @@ -15,7 +15,7 @@ import 'package:pinball_flame/pinball_flame.dart'; /// {@endtemplate} class ScoringBehavior extends Component with HasGameRef, FlameBlocReader { - /// {@macto scoring_behavior} + /// {@macro scoring_behavior} ScoringBehavior({ required Points points, required Vector2 position, diff --git a/lib/game/components/backbox/displays/initials_input_display.dart b/lib/game/components/backbox/displays/initials_input_display.dart index 68c58f43..54780c2d 100644 --- a/lib/game/components/backbox/displays/initials_input_display.dart +++ b/lib/game/components/backbox/displays/initials_input_display.dart @@ -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() .map((prompt) => prompt.char) diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index 026471c7..f1d1b09e 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -143,7 +143,7 @@ class PinballGame extends PinballForge2DGame final rocket = descendants().whereType().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().single.pullFor(2); } else { diff --git a/packages/pinball_audio/lib/src/pinball_audio.dart b/packages/pinball_audio/lib/src/pinball_audio.dart index 0364c923..1756d965 100644 --- a/packages/pinball_audio/lib/src/pinball_audio.dart +++ b/packages/pinball_audio/lib/src/pinball_audio.dart @@ -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), diff --git a/packages/pinball_components/lib/src/components/ball/ball.dart b/packages/pinball_components/lib/src/components/ball/ball.dart index af7a0361..806e1905 100644 --- a/packages/pinball_components/lib/src/components/ball/ball.dart +++ b/packages/pinball_components/lib/src/components/ball/ball.dart @@ -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. diff --git a/packages/pinball_components/lib/src/components/bumping_behavior.dart b/packages/pinball_components/lib/src/components/bumping_behavior.dart index af0d07c3..17931838 100644 --- a/packages/pinball_components/lib/src/components/bumping_behavior.dart +++ b/packages/pinball_components/lib/src/components/bumping_behavior.dart @@ -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(); diff --git a/packages/pinball_components/lib/src/components/flipper/behaviors/flipper_jointing_behavior.dart b/packages/pinball_components/lib/src/components/flipper/behaviors/flipper_jointing_behavior.dart index eb29c181..8e487141 100644 --- a/packages/pinball_components/lib/src/components/flipper/behaviors/flipper_jointing_behavior.dart +++ b/packages/pinball_components/lib/src/components/flipper/behaviors/flipper_jointing_behavior.dart @@ -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 { diff --git a/packages/pinball_components/lib/src/components/joint_anchor.dart b/packages/pinball_components/lib/src/components/joint_anchor.dart index 63875d40..ceba41e3 100644 --- a/packages/pinball_components/lib/src/components/joint_anchor.dart +++ b/packages/pinball_components/lib/src/components/joint_anchor.dart @@ -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} diff --git a/packages/pinball_components/lib/src/components/plunger.dart b/packages/pinball_components/lib/src/components/plunger.dart index 44a91b0b..6f38eb37 100644 --- a/packages/pinball_components/lib/src/components/plunger.dart +++ b/packages/pinball_components/lib/src/components/plunger.dart @@ -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} diff --git a/packages/pinball_components/lib/src/components/slingshot.dart b/packages/pinball_components/lib/src/components/slingshot.dart index 5d9e7849..2ebaff9b 100644 --- a/packages/pinball_components/lib/src/components/slingshot.dart +++ b/packages/pinball_components/lib/src/components/slingshot.dart @@ -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, diff --git a/packages/pinball_components/test/src/components/bumping_behavior_test.dart b/packages/pinball_components/test/src/components/bumping_behavior_test.dart index dd0493f7..07e35cca 100644 --- a/packages/pinball_components/test/src/components/bumping_behavior_test.dart +++ b/packages/pinball_components/test/src/components/bumping_behavior_test.dart @@ -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) diff --git a/packages/pinball_components/test/src/components/flapper/flapper_test.dart b/packages/pinball_components/test/src/components/flapper/flapper_test.dart index 497bb5f6..c9be94f9 100644 --- a/packages/pinball_components/test/src/components/flapper/flapper_test.dart +++ b/packages/pinball_components/test/src/components/flapper/flapper_test.dart @@ -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); diff --git a/packages/pinball_components/test/src/components/initial_position_test.dart b/packages/pinball_components/test/src/components/initial_position_test.dart index 9f015150..b7495181 100644 --- a/packages/pinball_components/test/src/components/initial_position_test.dart +++ b/packages/pinball_components/test/src/components/initial_position_test.dart @@ -54,7 +54,7 @@ void main() { ); flameTester.test( - 'deafaults to zero ' + 'defaults to zero ' 'when no initialPosition is given', (game) async { final component = TestBodyComponent(); diff --git a/packages/pinball_components/test/src/components/plunger_test.dart b/packages/pinball_components/test/src/components/plunger_test.dart index ea1ba826..e28bdaed 100644 --- a/packages/pinball_components/test/src/components/plunger_test.dart +++ b/packages/pinball_components/test/src/components/plunger_test.dart @@ -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); diff --git a/packages/pinball_flame/lib/src/canvas/canvas_component.dart b/packages/pinball_flame/lib/src/canvas/canvas_component.dart index ca6e64d0..394b0852 100644 --- a/packages/pinball_flame/lib/src/canvas/canvas_component.dart +++ b/packages/pinball_flame/lib/src/canvas/canvas_component.dart @@ -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} diff --git a/packages/pinball_flame/lib/src/pinball_forge2d_game.dart b/packages/pinball_flame/lib/src/pinball_forge2d_game.dart index 0013dd26..b98e78ae 100644 --- a/packages/pinball_flame/lib/src/pinball_forge2d_game.dart +++ b/packages/pinball_flame/lib/src/pinball_forge2d_game.dart @@ -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} diff --git a/packages/pinball_flame/test/src/canvas/canvas_component_test.dart b/packages/pinball_flame/test/src/canvas/canvas_component_test.dart index 7bf7fd88..2ad45b6c 100644 --- a/packages/pinball_flame/test/src/canvas/canvas_component_test.dart +++ b/packages/pinball_flame/test/src/canvas/canvas_component_test.dart @@ -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(); diff --git a/packages/pinball_flame/test/src/component_controller_test.dart b/packages/pinball_flame/test/src/component_controller_test.dart index 0e08be92..addcf2b0 100644 --- a/packages/pinball_flame/test/src/component_controller_test.dart +++ b/packages/pinball_flame/test/src/component_controller_test.dart @@ -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, ); }, diff --git a/packages/pinball_flame/test/src/pinball_forge2d_game_test.dart b/packages/pinball_flame/test/src/pinball_forge2d_game_test.dart index b8dc9fcc..2da32f0e 100644 --- a/packages/pinball_flame/test/src/pinball_forge2d_game_test.dart +++ b/packages/pinball_flame/test/src/pinball_forge2d_game_test.dart @@ -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()), diff --git a/packages/pinball_ui/lib/src/widgets/animated_ellipsis_text.dart b/packages/pinball_ui/lib/src/widgets/animated_ellipsis_text.dart index 9b52d604..1c94cad7 100644 --- a/packages/pinball_ui/lib/src/widgets/animated_ellipsis_text.dart +++ b/packages/pinball_ui/lib/src/widgets/animated_ellipsis_text.dart @@ -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. diff --git a/packages/pinball_ui/lib/src/widgets/crt_background.dart b/packages/pinball_ui/lib/src/widgets/crt_background.dart index 202af1d3..6fcc22ee 100644 --- a/packages/pinball_ui/lib/src/widgets/crt_background.dart +++ b/packages/pinball_ui/lib/src/widgets/crt_background.dart @@ -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} diff --git a/packages/pinball_ui/lib/src/widgets/pinball_dpad_button.dart b/packages/pinball_ui/lib/src/widgets/pinball_dpad_button.dart index 6d929f53..a0c3e653 100644 --- a/packages/pinball_ui/lib/src/widgets/pinball_dpad_button.dart +++ b/packages/pinball_ui/lib/src/widgets/pinball_dpad_button.dart @@ -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, diff --git a/packages/platform_helper/test/src/platform_helper_test.dart b/packages/platform_helper/test/src/platform_helper_test.dart index 69bec3a8..935bf082 100644 --- a/packages/platform_helper/test/src/platform_helper_test.dart +++ b/packages/platform_helper/test/src/platform_helper_test.dart @@ -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); diff --git a/test/game/components/backbox/displays/initials_input_display_test.dart b/test/game/components/backbox/displays/initials_input_display_test.dart index 1b92aedd..fd61c2c2 100644 --- a/test/game/components/backbox/displays/initials_input_display_test.dart +++ b/test/game/components/backbox/displays/initials_input_display_test.dart @@ -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')); }, ); diff --git a/test/game/components/bottom_group_test.dart b/test/game/components/bottom_group_test.dart index fab8dfaf..832d96d6 100644 --- a/test/game/components/bottom_group_test.dart +++ b/test/game/components/bottom_group_test.dart @@ -95,9 +95,9 @@ void main() { ), ); - final basebottomGroups = + final baseBottomGroups = bottomGroup.descendants().whereType(); - expect(basebottomGroups.length, equals(2)); + expect(baseBottomGroups.length, equals(2)); }, ); diff --git a/test/game/components/game_bloc_status_listener_test.dart b/test/game/components/game_bloc_status_listener_test.dart index f2018fbd..3151e70b 100644 --- a/test/game/components/game_bloc_status_listener_test.dart +++ b/test/game/components/game_bloc_status_listener_test.dart @@ -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(); diff --git a/test/select_character/cubit/character_theme_cubit_test.dart b/test/select_character/cubit/character_theme_cubit_test.dart index 967eb1e1..a9d03d75 100644 --- a/test/select_character/cubit/character_theme_cubit_test.dart +++ b/test/select_character/cubit/character_theme_cubit_test.dart @@ -14,7 +14,7 @@ void main() { }); blocTest( - 'charcterSelected emits selected character theme', + 'characterSelected emits selected character theme', build: CharacterThemeCubit.new, act: (bloc) => bloc.characterSelected(const SparkyTheme()), expect: () => [