diff --git a/.gitignore b/.gitignore index 0ea088942..85d9a051d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,13 @@ coverage/ # Files generated by Mason mason-lock.json -.mason \ No newline at end of file +.mason + +# Everyone should be free to customize +# AI assistants as they see fit. + +.claude/ +CLAUDE.local.md + +.codex/ +.cursor/ \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..521703af4 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +# Very Good Ventures + +At its core, VGV prefers code that embodies clear, concise mental models. We prefer to think deeply about the problem we are solving and find the solution that best fits. + +- Example 1: a file with many boolean variables might be implemented more cleanly as a state machine (using a bloc, cubit, or other package/pattern). +- Example 2: a file with a series of complex async operations may be better described as a series of stream transforms, an observable primitive, or even a composite. + +If you recognize a key insight that would clean something up but do not have what you need on hand to implement it, please just say so. Adding a package reference is easy. + +Our criteria for good code also enables us to achieve 100% test coverage. + +Good code has... + +- as few branches as possible +- injectable dependencies +- well-named identifiers +- no sibling dependencies in the same architectural layer + +To avoid sibling dependencies, state must either be lifted up to a common ancestor and passed down, or pushed down and subscribed to. + +See CONTRIBUTING.md for development details. diff --git a/test/helpers/command_helper.dart b/test/helpers/command_helper.dart index c18d02d69..82eb9305a 100644 --- a/test/helpers/command_helper.dart +++ b/test/helpers/command_helper.dart @@ -15,7 +15,7 @@ void Function() _overridePrint(void Function(List) fn) { return () { final printLogs = []; final spec = ZoneSpecification( - print: (_, _, _, String msg) { + print: (_, _, _, msg) { printLogs.add(msg); }, ); diff --git a/test/src/commands/dart/commands/dart_test_test.dart b/test/src/commands/dart/commands/dart_test_test.dart index 42361a7c9..dfb56f577 100644 --- a/test/src/commands/dart/commands/dart_test_test.dart +++ b/test/src/commands/dart/commands/dart_test_test.dart @@ -86,7 +86,7 @@ void main() { dartTest = _MockDartTestCommand(); testCommand = DartTestCommand( logger: logger, - dartInstalled: ({required Logger logger}) async => isFlutterInstalled, + dartInstalled: ({required logger}) async => isFlutterInstalled, dartTest: dartTest.call, )..argResultOverrides = argResults; when( diff --git a/test/src/commands/packages/commands/check/commands/licenses_test.dart b/test/src/commands/packages/commands/check/commands/licenses_test.dart index 11f0bdce5..144bf9a8b 100644 --- a/test/src/commands/packages/commands/check/commands/licenses_test.dart +++ b/test/src/commands/packages/commands/check/commands/licenses_test.dart @@ -1095,7 +1095,7 @@ and limitations under the License.'''); veryGoodTestRunnerConfigPackage, cliCompletionConfigPackage, }); - detectLicenseOverride = (String name, _) async { + detectLicenseOverride = (name, _) async { final detectorResult = _MockResult(); final licenseMatch = name == veryGoodTestRunnerConfigPackage.name ? [mitLicenseMatch] @@ -1142,7 +1142,7 @@ and limitations under the License.'''); veryGoodTestRunnerConfigPackage, cliCompletionConfigPackage, }); - detectLicenseOverride = (String name, _) async { + detectLicenseOverride = (name, _) async { final detectorResult = _MockResult(); final licenseMatch = name == veryGoodTestRunnerConfigPackage.name ? [mitLicenseMatch] @@ -1191,7 +1191,7 @@ and limitations under the License.'''); veryGoodTestRunnerConfigPackage, cliCompletionConfigPackage, }); - detectLicenseOverride = (String name, _) async { + detectLicenseOverride = (name, _) async { final detectorResult = _MockResult(); final licenseMatch = name == veryGoodTestRunnerConfigPackage.name ? [mitLicenseMatch] @@ -1315,7 +1315,7 @@ and limitations under the License.'''); veryGoodTestRunnerConfigPackage.name: [mitLicenseMatch], cliCompletionConfigPackage.name: [bsdLicenseMatch], }; - detectLicenseOverride = (String name, _) async { + detectLicenseOverride = (name, _) async { final detectorResult = _MockResult(); final licenseMatch = packageLicenseMatch[name]!; @@ -1364,7 +1364,7 @@ and limitations under the License.'''); veryGoodTestRunnerConfigPackage.name: [mitLicenseMatch], cliCompletionConfigPackage.name: [bsdLicenseMatch], }; - detectLicenseOverride = (String name, _) async { + detectLicenseOverride = (name, _) async { final detectorResult = _MockResult(); final licenseMatch = packageLicenseMatch[name]!; @@ -1415,7 +1415,7 @@ and limitations under the License.'''); veryGoodTestRunnerConfigPackage.name: [mitLicenseMatch], cliCompletionConfigPackage.name: [bsdLicenseMatch], }; - detectLicenseOverride = (String name, _) async { + detectLicenseOverride = (name, _) async { final detectorResult = _MockResult(); final licenseMatch = packageLicenseMatch[name]!; diff --git a/test/src/commands/test/test_test.dart b/test/src/commands/test/test_test.dart index 0dd685cb1..1ab4fa2e2 100644 --- a/test/src/commands/test/test_test.dart +++ b/test/src/commands/test/test_test.dart @@ -87,8 +87,7 @@ void main() { flutterTest = _MockFlutterTestCommand(); testCommand = TestCommand( logger: logger, - flutterInstalled: ({required Logger logger}) async => - isFlutterInstalled, + flutterInstalled: ({required logger}) async => isFlutterInstalled, flutterTest: flutterTest.call, )..argResultOverrides = argResults; when(