void verifyNoVersionChange()

in lib/src/license_detection/confidence.dart [155:180]


void verifyNoVersionChange(Iterable<Diff> diffs, String identifier) {
  var prevText = '';

  for (var diff in diffs) {
    final text = diff.text;

    if (diff.operation == Operation.insert) {
      var number = text;
      final index = text.indexOf(' ');

      if (index != -1) {
        number = number.substring(0, index);
      }

      if (_isVersionNumber(number) && prevText.endsWith('version')) {
        if (!prevText.endsWith('the standard version') &&
            !prevText.endsWith('the contributor version')) {
          throw LicenseMismatchException(
              'License does not match due to version change');
        }
      }
    } else if (diff.operation == Operation.equal) {
      prevText = text;
    }
  }
}