The existence of files matching configured globs will trigger a version bump
968140
def detect_file_triggers(trigger_patterns):
    """"""
    triggers = set()
    for trigger, pattern in trigger_patterns.items():
        matches = glob.glob(pattern)
        if matches:
            _LOG.debug("trigger: %s bump from %r\n\t%s", trigger, pattern, matches)
            triggers.add(trigger)
        else:
            _LOG.debug("trigger: no match on %r", pattern)
    return triggers
845248
function setVersion(type, suffix) {
        var file = 'package.json',
            VERSION_REGEX = /([\'|\"]version[\'|\"][ ]*:[ ]*[\'|\"])([\d|.]*)(-\w+)*([\'|\"])/,
            contents = grunt.file.read(file),
            version;
        contents = contents.replace(VERSION_REGEX, function(match, left, center) {
            version = center;
            if (type) {
                version = require('semver').inc(version, type);
            }
            //semver.inc strips our suffix if it existed
            if (suffix) {
                version += '-' + suffix;
            }
            return left + version + '"';
        });
        grunt.log.ok('Version set to ' + version.cyan);
        grunt.file.write(file, contents);
        return version;
    }
993437
def _ensure_config_file_exists():
    
    config_file = Path(ELIBConfig.config_file_path).absolute()
    if not config_file.exists():
        raise ConfigFileNotFoundError(ELIBConfig.config_file_path)
1362275
def matching(self):
        
        for sbo in self.package_not_found:
            for pkg in self.data:
                if sbo in pkg and pkg not in self.blacklist:
                    self.package_found.append(pkg)
1193881
def obsolete_files
      out = (existing_files - new_files - new_dirs + replaced_files).to_a
      Jekyll::Hooks.trigger :clean, :on_obsolete, out
      out
    end
1367987
function globWithPromsie(pattern) {
  return new Promise((resolve, reject) => {
    glob(pattern, function(err, files) {
      if (err) {
        reject(err);
      }

      if (files.length === 0) {
        console.warn('pattern "' + pattern + '" does not match any file');
      }

      resolve(files);
    });
  });
}
708814
def check_if_exists(self):
        """"""
        if self.req is None:
            return False
        try:
            self.satisfied_by = pkg_resources.get_distribution(self.req)
        except pkg_resources.DistributionNotFound:
            return False
        except pkg_resources.VersionConflict:
            self.conflicts_with = pkg_resources.get_distribution(self.req.project_name)
        return True
364390
def addMatch(self, version, filename, lineno, loglevel, trigger):
        
        self.versions.add(version)
        self.matches[version].append((filename, lineno, loglevel, trigger))
1327881
function ( version, options ){
			
		var matches;
		
		//First if version is 'readme' or 'plugin' version values
		if( version === 'readme' ){
			var readme = grunt.file.read( options.readme );
			matches = readme.match( new RegExp("^Stable tag:\\s*(\\S+)","im") );
			
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		
		}else if( version === 'plugin' ){
			var plugin = grunt.file.read( options.plugin );
			matches = plugin.match( new RegExp("^[\* ]*Version:\\s*(\\S+)","im") );
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		}
		
		return version;
	}
953616
def glob_files_locally(folder_path, pattern):
    """"""

    pattern = os.path.join(
        folder_path, pattern.lstrip('/')) if pattern else None

    len_folder_path = len(folder_path) + 1
    for root, _, files in os.walk(folder_path):
        for f in files:
            full_path = os.path.join(root, f)
            if not pattern or _match_path(full_path, pattern):
                yield (full_path, full_path[len_folder_path:])
941468
def set_version(version, rootdir = Dir.pwd, options = {})
      exit_status = 0
      type    = (options[:type])    ? options[:type]    : FalkorLib.config[:versioning][:type]
      source  = (options[:source])  ? options[:source]  : FalkorLib.config[:versioning][:source][ type ]
      versionfile = File.join( rootdir, source[:filename] ) unless source[:filename].nil?
      major, minor, patch = major(version), minor(version), patch(version)
      #tocommit = ""
      case type
      when 'file'
        info "writing version changes in #{source[:filename]}"
        File.open(versionfile, 'w') { |f| f.puts version } #if File.exist? ( versionfile )
      when 'gem'
        info "=> writing version changes in #{source[:filename]}"
        File.open(versionfile, 'r+') do |f|
          text = f.read
          text.gsub!(/^(\s*)MAJOR\s*,\s*MINOR,\s*PATCH\s*=\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(.*)$/,
                     '\1' + "MAJOR, MINOR, PATCH = #{major}, #{minor}, #{patch}" + '\5')
          f.rewind
          f.write(text)
        end
      when 'puppet_module'
        info "=> writing version changes in #{source[:filename]}"
        metadata = JSON.parse( IO.read( versionfile ) )
        metadata["version"] = version
        File.open(versionfile, "w") do |f|
          f.write JSON.pretty_generate( metadata )
        end
        #exit 1
      end
      if FalkorLib::Git.init?(rootdir)
        filelist = FalkorLib::Git.list_files( rootdir )
        Dir.chdir( rootdir ) do
          next if source[:filename].nil?
          unless filelist.include?( source[:filename] )
            warning "The version file #{source[:filename]} is not part of the Git repository"
            answer = ask("Adding the file to the repository? (Y|n)", 'Yes')
            next if answer =~ /n.*/i
            exit_status = FalkorLib::Git.add(versionfile, "Adding the version file '#{source[:filename]}', inialized to the '#{version}' version" )
            next
          end
          run %( git diff #{source[:filename]} )
          answer = ask(cyan("=> Commit the changes of the version file to the repository? (Y|n)"), 'Yes')
          next if answer =~ /n.*/i
          run %( git commit -s -m "bump to version '#{version}'" #{source[:filename]} )
          exit_status = $?.to_i
          # if (type == 'gem' && File.exists?(File.join(rootdir, 'Gemfile')) )
          #     run %{
          #        sleep 2
          #        bundle update falkorlib
          #        git commit -s -m "Update Gemfile.lock accordingly" Gemfile.lock
          #     } if command?( 'bundle' )
          # end
        end
      end
      exit_status
    end
1134809
def dotperu_exclude_case_insensitive_git_globs():
    """"""
    globs = []
    for capitalization in DOTPERU_CAPITALIZATIONS:
        globs.append(capitalization + '/**')
        globs.append('**/' + capitalization + '/**')
    return globs
895607
def bump_version(ctx, new_version, version_part=None, dry_run=False):
    """"""
    version_part = version_part or "minor"
    if dry_run:
        ctx = DryRunContext(ctx)
    ctx.run("bumpversion --new-version={} {}".format(new_version,
                                                      version_part))
1362519
function filesPatch(oldFile, newFile, options) {
  let { diff, toFile } = utils;
  let opts = options || {};

  oldFile = toFile(oldFile, options);
  newFile = toFile(newFile, options);

  let nameA = oldFile.relative;
  let nameB = newFile.relative;

  let strA = oldFile.contents.toString();
  let strB = newFile.contents.toString();

  return diff.createTwoFilesPatch(nameA, nameB, strA, strB, opts.oldHeader, opts.newHeader, opts);
}
1330713
async function nextVersion (bumpType, version) {
  if (utils.isNightly(version) || utils.isBeta(version)) {
    switch (bumpType) {
      case 'nightly':
        version = await utils.nextNightly(version)
        break
      case 'beta':
        version = await utils.nextBeta(version)
        break
      case 'stable':
        version = semver.valid(semver.coerce(version))
        break
      default:
        throw new Error('Invalid bump type.')
    }
  } else if (utils.isStable(version)) {
    switch (bumpType) {
      case 'nightly':
        version = utils.nextNightly(version)
        break
      case 'beta':
        throw new Error('Cannot bump to beta from stable.')
      case 'stable':
        version = semver.inc(version, 'patch')
        break
      default:
        throw new Error('Invalid bump type.')
    }
  } else {
    throw new Error(`Invalid current version: ${version}`)
  }
  return version
}
842811
private static function preReleaseEquals(PreRelease $v1, PreRelease $v2)
    {
        // If they don't match on the versionable level they can not match
        if (!self::versionableEquals($v1, $v2)) {
            return false;
        }

        // Both other parts need to match
        if ($v1->getGreek() !== $v2->getGreek()) {
            return false;
        }
        if ($v1->getReleaseNumber() !== $v2->getReleaseNumber()) {
            return false;
        }

        return true;
    }
589077
def should_copy_file(remote_storage, path, prefixed_path, source_storage):
    
    if has_matching_etag(
            remote_storage, source_storage, path, prefixed_path):
        logger.info("%s: Skipping based on matching file hashes" % path)
        return False

    # Invalidate cached versions of lookup before copy
    destroy_etag(path)
    logger.info("%s: Hashes did not match" % path)
    return True