hasGeneratedMarker static method

bool hasGeneratedMarker(
  1. String content,
  2. CommentStyle style
)

Check if file content contains generated file markers

Implementation

static bool hasGeneratedMarker(String content, CommentStyle style) {
  // Only check the first 50 lines for performance
  final lines = content.split('\n');
  final linesToCheck = lines.take(50).join('\n');

  final markers = _getMarkersForStyle(style);

  for (final marker in markers) {
    if (marker.hasMatch(linesToCheck)) {
      return true;
    }
  }
  return false;
}