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 3 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 flutter_version: 2.10.5
coverage_excludes: "lib/gen/*.dart" coverage_excludes: "lib/gen/*.dart"
test_optimization: false 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} /// {@endtemplate}
class ScoringBehavior extends Component class ScoringBehavior extends Component
with HasGameRef, FlameBlocReader<GameBloc, GameState> { with HasGameRef, FlameBlocReader<GameBloc, GameState> {
/// {@macto scoring_behavior} /// {@macro scoring_behavior}
ScoringBehavior({ ScoringBehavior({
required Points points, required Points points,
required Vector2 position, 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 String get initials => children
.whereType<InitialsLetterPrompt>() .whereType<InitialsLetterPrompt>()
.map((prompt) => prompt.char) .map((prompt) => prompt.char)

@ -143,7 +143,7 @@ class PinballGame extends PinballForge2DGame
final rocket = descendants().whereType<RocketSpriteComponent>().first; final rocket = descendants().whereType<RocketSpriteComponent>().first;
final bounds = rocket.topLeftPosition & rocket.size; 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())) { if (bounds.contains(info.eventPosition.game.toOffset())) {
descendants().whereType<Plunger>().single.pullFor(2); descendants().whereType<Plunger>().single.pullFor(2);
} else { } else {

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

@ -68,7 +68,7 @@ class Ball extends BodyComponent with Layered, InitialPosition, ZIndex {
return world.createBody(bodyDef)..createFixtureFromShape(shape, 1); 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 /// The [Ball] will no longer be affected by any forces, including it's
/// weight and those emitted from collisions. /// weight and those emitted from collisions.

@ -12,7 +12,7 @@ class BumpingBehavior extends ContactBehavior {
/// Determines how strong the bump is. /// Determines how strong the bump is.
final double _strength; 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. /// coordinates.
@visibleForTesting @visibleForTesting
final WorldManifold worldManifold = WorldManifold(); final WorldManifold worldManifold = WorldManifold();

@ -40,7 +40,7 @@ class _FlipperAnchor extends JointAnchor {
} }
/// {@template flipper_anchor_revolute_joint_def} /// {@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. /// motion.
/// {@endtemplate} /// {@endtemplate}
class _FlipperAnchorRevoluteJointDef extends RevoluteJointDef { class _FlipperAnchorRevoluteJointDef extends RevoluteJointDef {

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

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

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

@ -32,7 +32,7 @@ void main() {
}); });
flameTester.testGameWidget( flameTester.testGameWidget(
'the bump is greater when the strengh is greater', 'the bump is greater when the strength is greater',
setUp: (game, tester) async { setUp: (game, tester) async {
final component1 = _TestBodyComponent(); final component1 = _TestBodyComponent();
final behavior1 = BumpingBehavior(strength: 1) 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 { (game) async {
final flapper = Flapper(); final flapper = Flapper();
await game.ensureAdd(flapper); await game.ensureAdd(flapper);

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

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

@ -12,7 +12,7 @@ typedef PaintFunction = void Function(Paint);
/// {@template canvas_component} /// {@template canvas_component}
/// Allows listening before the rendering of [Sprite]s. /// 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 /// provide a global way to modify the default [Paint] before rendering a
/// [Sprite]. /// [Sprite].
/// {@endtemplate} /// {@endtemplate}

@ -4,7 +4,7 @@ import 'package:flame/game.dart';
import 'package:flame_forge2d/flame_forge2d.dart'; import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_forge2d/world_contact_listener.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} /// {@template pinball_forge2d_game}
/// A [Game] that uses the Forge2D physics engine. /// A [Game] that uses the Forge2D physics engine.
/// {@endtemplate} /// {@endtemplate}

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

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

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

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:flutter/material.dart'; 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 /// 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 /// [text]. Once 3 `.` have been added (e.g. `Loading...`), it will reset to
/// zero ellipsis and start over again. /// zero ellipsis and start over again.

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

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:pinball_ui/gen/gen.dart'; import 'package:pinball_ui/gen/gen.dart';
import 'package:pinball_ui/pinball_ui.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 { enum PinballDpadDirection {
/// Up /// Up
up, up,

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

@ -129,7 +129,7 @@ void main() {
}, },
); );
String? submitedInitials; String? submittedInitials;
flameTester.testGameWidget( flameTester.testGameWidget(
'submits the initials', 'submits the initials',
setUp: (game, tester) async { setUp: (game, tester) async {
@ -138,7 +138,7 @@ void main() {
score: 1000, score: 1000,
characterIconPath: game.characterIconPath, characterIconPath: game.characterIconPath,
onSubmit: (value) { onSubmit: (value) {
submitedInitials = value; submittedInitials = value;
}, },
); );
await game.pump(component); await game.pump(component);
@ -147,7 +147,7 @@ void main() {
await tester.pump(); await tester.pump();
}, },
verify: (game, tester) async { 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>(); bottomGroup.descendants().whereType<Baseboard>();
expect(basebottomGroups.length, equals(2)); expect(baseBottomGroups.length, equals(2));
}, },
); );

@ -162,7 +162,7 @@ void main() {
); );
flameTester.test( flameTester.test(
'removes FlipperKeyControllingBehavior from Fipper', 'removes FlipperKeyControllingBehavior from Flipper',
(game) async { (game) async {
final component = GameBlocStatusListener(); final component = GameBlocStatusListener();
final repository = _MockLeaderboardRepository(); final repository = _MockLeaderboardRepository();
@ -242,7 +242,7 @@ void main() {
); );
flameTester.test( 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 { (game) async {
final component = GameBlocStatusListener(); final component = GameBlocStatusListener();
final repository = _MockLeaderboardRepository(); final repository = _MockLeaderboardRepository();

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

Loading…
Cancel
Save