Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,3 @@ Naming/BlockForwarding:
Enabled: false
Style/MutableConstant:
Enabled: false
Style/RedundantFreeze:
Enabled: false
2 changes: 1 addition & 1 deletion bundler/helpers/v1/lib/functions/lockfile_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LockfileUpdater
locked\sto\s(?<name>[^\s]+)\s\(|
not\sfind\s(?<name>[^\s]+)-\d|
has\s(?<name>[^\s]+)\slocked\sat
/x.freeze
/x

def initialize(gemfile_name:, lockfile_name:, dependencies:)
@gemfile_name = gemfile_name
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v1/lib/functions/version_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Functions
class VersionResolver
GEM_NOT_FOUND_ERROR_REGEX = /locked to (?<name>[^\s]+) \(/.freeze
GEM_NOT_FOUND_ERROR_REGEX = /locked to (?<name>[^\s]+) \(/

attr_reader :dependency_name, :dependency_requirements,
:gemfile_name, :lockfile_name
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v1/spec/native_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Duplicated in lib/dependabot/bundler/file_updater/lockfile_updater.rb
# TODO: Stop sanitizing the lockfile once we have bundler 2 installed
LOCKFILE_ENDING = /(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m.freeze
LOCKFILE_ENDING = /(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m

def project_dependency_files(project)
project_path = File.expand_path(File.join("../../spec/fixtures/projects/bundler1", project))
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v2/lib/functions/lockfile_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LockfileUpdater
locked\sto\s(?<name>[^\s]+)\s\(|
not\sfind\s(?<name>[^\s]+)-\d|
has\s(?<name>[^\s]+)\slocked\sat
/x.freeze
/x
DEPENDENCY_DROPPED = "_dependency_dropped_"

def initialize(gemfile_name:, lockfile_name:, dependencies:)
Expand Down
2 changes: 1 addition & 1 deletion bundler/helpers/v2/lib/functions/version_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Functions
class VersionResolver
GEM_NOT_FOUND_ERROR_REGEX = /locked to (?<name>[^\s]+) \(/.freeze
GEM_NOT_FOUND_ERROR_REGEX = /locked to (?<name>[^\s]+) \(/

attr_reader :dependency_name, :dependency_requirements,
:gemfile_name, :lockfile_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ class LockfileUpdater
require_relative "gemspec_dependency_name_finder"
require_relative "ruby_requirement_setter"

LOCKFILE_ENDING =
/(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m.freeze
GIT_DEPENDENCIES_SECTION = /GIT\n.*?\n\n(?!GIT)/m.freeze
GIT_DEPENDENCY_DETAILS = /GIT\n.*?\n\n/m.freeze
LOCKFILE_ENDING = /(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m
GIT_DEPENDENCIES_SECTION = /GIT\n.*?\n\n(?!GIT)/m
GIT_DEPENDENCY_DETAILS = /GIT\n.*?\n\n/m

# Can't be a constant because some of these don't exist in bundler
# 1.15, which Heroku uses, which causes an exception on boot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def space_after_specifier?(requirement_nodes)
req_string.include?(" ")
end

EQUALITY_OPERATOR = /(?<![<>!])=/.freeze
EQUALITY_OPERATOR = /(?<![<>!])=/

def use_equality_operator?(requirement_nodes)
return true if requirement_nodes.none?
Expand Down
2 changes: 1 addition & 1 deletion bundler/lib/dependabot/bundler/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Helpers
# it was created with an old version that didn't add this information
FAILOVER = V1

BUNDLER_MAJOR_VERSION_REGEX = /BUNDLED WITH\s+(?<version>\d+)\./m.freeze
BUNDLER_MAJOR_VERSION_REGEX = /BUNDLED WITH\s+(?<version>\d+)\./m

def self.bundler_version(lockfile)
return DEFAULT unless lockfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UpdateChecker
# version allowed by the gemspec, if the gemspec has a required ruby
# version range
class FilePreparer
VERSION_REGEX = /[0-9]+(?:\.[A-Za-z0-9\-_]+)*/.freeze
VERSION_REGEX = /[0-9]+(?:\.[A-Za-z0-9\-_]+)*/

# Can't be a constant because some of these don't exist in bundler
# 1.15, which Heroku uses, which causes an exception on boot.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@ module Dependabot
module Bundler
class UpdateChecker
module SharedBundlerHelpers
GIT_REGEX = /reset --hard [^\s]*` in directory (?<path>[^\s]*)/.freeze
GIT_REF_REGEX = /not exist in the repository (?<path>[^\s]*)\./.freeze
PATH_REGEX = /The path `(?<path>.*)` does not exist/.freeze
GIT_REGEX = /reset --hard [^\s]*` in directory (?<path>[^\s]*)/
GIT_REF_REGEX = /not exist in the repository (?<path>[^\s]*)\./
PATH_REGEX = /The path `(?<path>.*)` does not exist/

module BundlerErrorPatterns
MISSING_AUTH_REGEX =
/bundle config (?<source>.*) username:password/.freeze
BAD_AUTH_REGEX =
/Bad username or password for (?<source>.*)\.$/.freeze
BAD_CERT_REGEX =
/verify the SSL certificate for (?<source>.*)\.$/.freeze
HTTP_ERR_REGEX =
/Could not fetch specs from (?<source>.*)$/.freeze
MISSING_AUTH_REGEX = /bundle config (?<source>.*) username:password/
BAD_AUTH_REGEX = /Bad username or password for (?<source>.*)\.$/
BAD_CERT_REGEX = /verify the SSL certificate for (?<source>.*)\.$/
HTTP_ERR_REGEX = /Could not fetch specs from (?<source>.*)$/
end

RETRYABLE_ERRORS = %w(
Expand Down
4 changes: 2 additions & 2 deletions cargo/lib/dependabot/cargo/file_updater/lockfile_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class LockfileUpdater
LOCKFILE_ENTRY_REGEX = /
\[\[package\]\]\n
(?:(?!^\[(\[package|metadata)).)+
/mx.freeze
/mx

LOCKFILE_CHECKSUM_REGEX = /^"checksum .*$/.freeze
LOCKFILE_CHECKSUM_REGEX = /^"checksum .*$/

def initialize(dependencies:, dependency_files:, credentials:)
@dependencies = dependencies
Expand Down
2 changes: 1 addition & 1 deletion cargo/lib/dependabot/cargo/requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Requirement < Gem::Requirement
version_pattern = Cargo::Version::VERSION_PATTERN

PATTERN_RAW = "\\s*(#{quoted})?\\s*(#{version_pattern})\\s*"
PATTERN = /\A#{PATTERN_RAW}\z/.freeze
PATTERN = /\A#{PATTERN_RAW}\z/

# Use Cargo::Version rather than Gem::Version to ensure that
# pre-release versions aren't transformed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UpdateChecker
class RequirementsUpdater
class UnfixableRequirement < StandardError; end

VERSION_REGEX = /[0-9]+(?:\.[A-Za-z0-9\-*]+)*/.freeze
VERSION_REGEX = /[0-9]+(?:\.[A-Za-z0-9\-*]+)*/
ALLOWED_UPDATE_STRATEGIES =
%i(bump_versions bump_versions_if_necessary).freeze

Expand Down
16 changes: 7 additions & 9 deletions cargo/lib/dependabot/cargo/update_checker/version_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ module Dependabot
module Cargo
class UpdateChecker
class VersionResolver
UNABLE_TO_UPDATE =
/Unable to update (?<url>.*?)$/.freeze
BRANCH_NOT_FOUND_REGEX =
/#{UNABLE_TO_UPDATE}.*to find branch `(?<branch>[^`]+)`/m.freeze
REVSPEC_PATTERN = /revspec '.*' not found/.freeze
OBJECT_PATTERN = /object not found - no match for id \(.*\)/.freeze
REF_NOT_FOUND_REGEX =
/#{UNABLE_TO_UPDATE}.*(#{REVSPEC_PATTERN}|#{OBJECT_PATTERN})/m.freeze
GIT_REF_NOT_FOUND_REGEX = /Updating git repository `(?<url>[^`]*)`.*fatal: couldn't find remote ref/m.freeze
UNABLE_TO_UPDATE = /Unable to update (?<url>.*?)$/
BRANCH_NOT_FOUND_REGEX = /#{UNABLE_TO_UPDATE}.*to find branch `(?<branch>[^`]+)`/m
REVSPEC_PATTERN = /revspec '.*' not found/
OBJECT_PATTERN = /object not found - no match for id \(.*\)/
REF_NOT_FOUND_REGEX = /#{UNABLE_TO_UPDATE}.*(#{REVSPEC_PATTERN}|#{OBJECT_PATTERN})/m
GIT_REF_NOT_FOUND_REGEX = /Updating git repository `(?<url>[^`]*)`.*fatal: couldn't find remote ref/m

def initialize(dependency:, credentials:,
original_dependency_files:, prepared_dependency_files:)
Expand Down Expand Up @@ -188,6 +185,7 @@ def handle_cargo_errors(error)
end

if error.message.include?("authenticate when downloading repo") ||
# TODO: stop catching this 200 error: https://github.com/dependabot/dependabot-core/pull/5332#discussion_r936888624
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this included by accident?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error.message.include?("HTTP 200 response: got 401") ||
error.message.include?("fatal: Authentication failed for")
# Check all dependencies for reachability (so that we raise a
Expand Down
2 changes: 1 addition & 1 deletion cargo/lib/dependabot/cargo/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Version < Gem::Version
VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' \
'(-[0-9A-Za-z-]+(\.[0-9a-zA-Z-]+)*)?' \
'(\+[0-9a-zA-Z]+(\.[0-9a-zA-Z]+)*)?'
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/

def initialize(version)
@version_string = version.to_s
Expand Down
4 changes: 2 additions & 2 deletions common/lib/dependabot/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

module Dependabot
class DependabotError < StandardError
BASIC_AUTH_REGEX = %r{://(?<auth>[^:]*:[^@%\s]+(@|%40))}.freeze
BASIC_AUTH_REGEX = %r{://(?<auth>[^:]*:[^@%\s]+(@|%40))}
# Remove any path segment from fury.io sources
FURY_IO_PATH_REGEX = %r{fury\.io/(?<path>.+)}.freeze
FURY_IO_PATH_REGEX = %r{fury\.io/(?<path>.+)}

def initialize(message = nil)
super(sanitize_message(message))
Expand Down
2 changes: 1 addition & 1 deletion common/lib/dependabot/git_commit_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GitCommitChecker
|
[0-9]+\.[0-9]+(?:\.[a-z0-9\-]+)*
)$
/ix.freeze
/ix

def initialize(dependency:, credentials:,
ignored_versions: [], raise_on_ignored: false,
Expand Down
2 changes: 1 addition & 1 deletion common/lib/dependabot/git_metadata_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

module Dependabot
class GitMetadataFetcher
KNOWN_HOSTS = /github\.com|bitbucket\.org|gitlab.com/i.freeze
KNOWN_HOSTS = /github\.com|bitbucket\.org|gitlab.com/i

def initialize(url:, credentials:)
@url = url
Expand Down
2 changes: 1 addition & 1 deletion common/lib/dependabot/pull_request_creator/labeler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Dependabot
class PullRequestCreator
class Labeler
DEPENDENCIES_LABEL_REGEX = %r{^[^/]*dependenc[^/]+$}i.freeze
DEPENDENCIES_LABEL_REGEX = %r{^[^/]*dependenc[^/]+$}i
DEFAULT_DEPENDENCIES_LABEL = "dependencies"
DEFAULT_SECURITY_LABEL = "security"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ module Dependabot
class PullRequestCreator
class MessageBuilder
class IssueLinker
REPO_REGEX = %r{(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)}.freeze
TAG_REGEX = /(?<tag>(?:\#|GH-)\d+)/i.freeze
REPO_REGEX = %r{(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)}
TAG_REGEX = /(?<tag>(?:\#|GH-)\d+)/i
ISSUE_LINK_REGEXS = [
/
(?:(?<=[^A-Za-z0-9\[\\]|^)\\*#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$))|
(?:(?<=\s|^)#{REPO_REGEX}#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$))
/x.freeze,
/\[#{TAG_REGEX}\](?=[^A-Za-z0-9\-\(])/.freeze,
/\[(?<tag>(?:\#|GH-)?\d+)\]\(\)/i.freeze
/x,
/\[#{TAG_REGEX}\](?=[^A-Za-z0-9\-\(])/,
/\[(?<tag>(?:\#|GH-)?\d+)\]\(\)/i
].freeze

attr_reader :source_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ module Dependabot
class PullRequestCreator
class MessageBuilder
class LinkAndMentionSanitizer
GITHUB_USERNAME = /[a-z0-9]+(-[a-z0-9]+)*/i.freeze
GITHUB_USERNAME = /[a-z0-9]+(-[a-z0-9]+)*/i
GITHUB_REF_REGEX = %r{
(?:https?://)?
github\.com/(?<repo>#{GITHUB_USERNAME}/[^/\s]+)/
(?:issue|pull)s?/(?<number>\d+)
}x.freeze
}x
# [^/\s#]+ means one or more characters not matching (^) the class /, whitespace (\s), or #
GITHUB_NWO_REGEX = %r{(?<repo>#{GITHUB_USERNAME}/[^/\s#]+)#(?<number>\d+)}.freeze
MENTION_REGEX = %r{(?<![A-Za-z0-9`~])@#{GITHUB_USERNAME}/?}.freeze
GITHUB_NWO_REGEX = %r{(?<repo>#{GITHUB_USERNAME}/[^/\s#]+)#(?<number>\d+)}
MENTION_REGEX = %r{(?<![A-Za-z0-9`~])@#{GITHUB_USERNAME}/?}
# regex to match a team mention on github
TEAM_MENTION_REGEX = %r{(?<![A-Za-z0-9`~])@(?<org>#{GITHUB_USERNAME})/(?<team>#{GITHUB_USERNAME})/?}.freeze
TEAM_MENTION_REGEX = %r{(?<![A-Za-z0-9`~])@(?<org>#{GITHUB_USERNAME})/(?<team>#{GITHUB_USERNAME})/?}
# End of string
EOS_REGEX = /\z/.freeze
EOS_REGEX = /\z/
COMMONMARKER_OPTIONS = %i(
GITHUB_PRE_LANG FULL_INFO_STRING
).freeze
Expand Down
14 changes: 7 additions & 7 deletions common/lib/dependabot/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Source
(?:\.com)[/:]
(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)
(?:(?:/tree|/blob)/(?<branch>[^/]+)/(?<directory>.*)[\#|/])?
}x.freeze
}x

GITHUB_ENTERPRISE_SOURCE = %r{
(?<protocol>(http://|https://|git://|ssh://))*
Expand All @@ -16,27 +16,27 @@ class Source
[/:]
(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)
(?:(?:/tree|/blob)/(?<branch>[^/]+)/(?<directory>.*)[\#|/])?
}x.freeze
}x

GITLAB_SOURCE = %r{
(?<provider>gitlab)
(?:\.com)[/:]
(?<repo>[^/]+/(?:(?!\.git)[^/])+((?!/tree|/blob/|/-)/[^/]+)?)
(?:(?:/tree|/blob)/(?<branch>[^/]+)/(?<directory>.*)[\#|/].*)?
}x.freeze
}x

BITBUCKET_SOURCE = %r{
(?<provider>bitbucket)
(?:\.org)[/:]
(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)
(?:(?:/src)/(?<branch>[^/]+)/(?<directory>.*)[\#|/])?
}x.freeze
}x

AZURE_SOURCE = %r{
(?<provider>azure)
(?:\.com)[/:]
(?<repo>[\w.-]+/([\w.-]+/)?(?:_git/)(?:(?!\.git|\.\s)[\w.-])+)
}x.freeze
}x

CODECOMMIT_SOURCE = %r{
(?<protocol>(http://|https://|git://|ssh://))
Expand All @@ -48,15 +48,15 @@ class Source
(?:/)?(?<directory>[^?]*)?
[?]?
(?<ref>.*)?
}x.freeze
}x

SOURCE_REGEX = /
(?:#{GITHUB_SOURCE})|
(?:#{GITLAB_SOURCE})|
(?:#{BITBUCKET_SOURCE})|
(?:#{AZURE_SOURCE})|
(?:#{CODECOMMIT_SOURCE})
/x.freeze
/x

IGNORED_PROVIDER_HOSTS = %w(gitbox.apache.org svn.apache.org fuchsia.googlesource.com).freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def initialize(extensions)
%r{
(?<=PHP\sextension\s)ext\-[^\s/]+\s.*?\s(?=is|but)|
(?<=requires\s)php(?:\-[^\s/]+)?\s.*?\s(?=but)
}x.freeze
}x
MISSING_IMPLICIT_PLATFORM_REQ_REGEX =
%r{
(?<!with|for|by)\sext\-[^\s/]+\s.*?\s(?=->)|
(?<=requires\s)php(?:\-[^\s/]+)?\s.*?\s(?=->)
}x.freeze
MISSING_ENV_VAR_REGEX = /Environment variable '(?<env_var>.[^']+)' is not set/.freeze
}x
MISSING_ENV_VAR_REGEX = /Environment variable '(?<env_var>.[^']+)' is not set/

def initialize(dependencies:, dependency_files:, credentials:)
@dependencies = dependencies
Expand Down
4 changes: 2 additions & 2 deletions composer/lib/dependabot/composer/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module Dependabot
module Composer
module Helpers
# From composers json-schema: https://getcomposer.org/schema.json
COMPOSER_V2_NAME_REGEX = %r{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$}.freeze
COMPOSER_V2_NAME_REGEX = %r{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$}

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0'.

Check failure

Code scanning / CodeQL

Inefficient regular expression

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0'.
# From https://github.com/composer/composer/blob/b7d770659b4e3ef21423bd67ade935572913a4c1/src/Composer/Repository/PlatformRepository.php#L33
PLATFORM_PACKAGE_REGEX = /
^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*
|composer-(?:plugin|runtime)-api)$
/x.freeze
/x

def self.composer_version(composer_json, parsed_lockfile = nil)
if parsed_lockfile && parsed_lockfile["plugin-api-version"]
Expand Down
5 changes: 2 additions & 3 deletions composer/lib/dependabot/composer/requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
module Dependabot
module Composer
class Requirement < Gem::Requirement
AND_SEPARATOR =
/(?<=[a-zA-Z0-9*])(?<!\sas)[\s,]+(?![\s,]*[|-]|as)/.freeze
OR_SEPARATOR = /(?<=[a-zA-Z0-9*])[\s,]*\|\|?\s*/.freeze
AND_SEPARATOR = /(?<=[a-zA-Z0-9*])(?<!\sas)[\s,]+(?![\s,]*[|-]|as)/
OR_SEPARATOR = /(?<=[a-zA-Z0-9*])[\s,]*\|\|?\s*/

def self.parse(obj)
new_obj = obj.gsub(/@\w+/, "").gsub(/[a-z0-9\-_\.]*\sas\s+/i, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ module Dependabot
module Composer
class UpdateChecker
class RequirementsUpdater
ALIAS_REGEX = /[a-z0-9\-_\.]*\sas\s+/.freeze
VERSION_REGEX =
/(?:#{ALIAS_REGEX})?[0-9]+(?:\.[a-zA-Z0-9*\-]+)*/.freeze
AND_SEPARATOR =
/(?<=[a-zA-Z0-9*])(?<!\sas)[\s,]+(?![\s,]*[|-]|as)/.freeze
OR_SEPARATOR = /(?<=[a-zA-Z0-9*])[\s,]*\|\|?\s*/.freeze
SEPARATOR = /(?:#{AND_SEPARATOR})|(?:#{OR_SEPARATOR})/.freeze
ALIAS_REGEX = /[a-z0-9\-_\.]*\sas\s+/
VERSION_REGEX = /(?:#{ALIAS_REGEX})?[0-9]+(?:\.[a-zA-Z0-9*\-]+)*/
AND_SEPARATOR = /(?<=[a-zA-Z0-9*])(?<!\sas)[\s,]+(?![\s,]*[|-]|as)/
OR_SEPARATOR = /(?<=[a-zA-Z0-9*])[\s,]*\|\|?\s*/
SEPARATOR = /(?:#{AND_SEPARATOR})|(?:#{OR_SEPARATOR})/
ALLOWED_UPDATE_STRATEGIES =
%i(widen_ranges bump_versions bump_versions_if_necessary).freeze

Expand Down
Loading