Skip to content
Snippets Groups Projects
Unverified Commit f837281f authored by James Lopez's avatar James Lopez
Browse files

Update regex to use union

parent 71f4ec45
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,7 +8,7 @@ module Gitlab
module FileDetector
PATTERNS = {
# Project files
readme: %r{\A(readme|index)(|\.#{Gitlab::MarkupHelper::EXTENSIONS.join('|\.')})$[^\/]*\z}i,
readme: %r{\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?$[^\/]*\z}i,
changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i,
license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i,
contributing: %r{\Acontributing[^/]*\z}i,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment