Skip to content

Commit

Permalink
Add ShouldGenerateFile to example (kevmoo#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyinkin committed Jul 2, 2023
1 parent bf99429 commit 375b552
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ analyzer:
strict-inference: true
strict-raw-types: true
exclude:
- 'example/src/example_test_golden.dart'
- 'test/src/goldens'

linter:
Expand Down
5 changes: 5 additions & 0 deletions example/src/example_test_golden.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
part of 'example_test_src.dart';

const TestClassFilePartOfCurrentNameLength = 26;

const TestClassFilePartOfCurrentNameLowerCase = 'testclassfilepartofcurrent';
8 changes: 8 additions & 0 deletions example/src/example_test_src.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ const TestClass2NameUpperCase = 'TESTCLASS2';
@ExampleAnnotation(includeUpperCase: true)
class TestClass2 {}

@ShouldGenerateFile(
'example_test_golden.dart',
partOfCurrent: true,
configurations: ['default', 'no-prefix-required'],
)
@ExampleAnnotation()
class TestClassFilePartOfCurrent {}

@ShouldGenerate(
r'''
const BadTestClassNameLength = 12;
Expand Down
2 changes: 1 addition & 1 deletion lib/source_gen_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export 'annotations.dart' show ShouldGenerate, ShouldThrow;
export 'annotations.dart' show ShouldGenerate, ShouldGenerateFile, ShouldThrow;
export 'src/build_log_tracking.dart'
show buildLogItems, clearBuildLog, initializeBuildLogTracking;
export 'src/generate_for_element.dart' show generateForElement;
Expand Down

0 comments on commit 375b552

Please sign in to comment.