Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
643c6f31
Commit
643c6f31
authored
Sep 06, 2018
by
J.D. Bean
Committed by
Rémy Coutable
Sep 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recognize 'UNLICENSE' license files
parent
4a14ff5b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
changelogs/unreleased/47440-recognize-unlicense-license-file.yml
...ogs/unreleased/47440-recognize-unlicense-license-file.yml
+5
-0
lib/gitlab/file_detector.rb
lib/gitlab/file_detector.rb
+1
-1
spec/lib/gitlab/file_detector_spec.rb
spec/lib/gitlab/file_detector_spec.rb
+5
-1
No files found.
changelogs/unreleased/47440-recognize-unlicense-license-file.yml
0 → 100644
View file @
643c6f31
---
title
:
Recognize 'UNLICENSE' license files
merge_request
:
21508
author
:
J.D. Bean
type
:
added
lib/gitlab/file_detector.rb
View file @
643c6f31
...
...
@@ -8,7 +8,7 @@ module Gitlab
# Project files
readme:
%r{
\A
readme[^/]*
\z
}i
,
changelog:
%r{
\A
(changelog|history|changes|news)[^/]*
\z
}i
,
license:
%r{
\A
(licen[sc]e|copying)(
\.
[^/]+)?
\z
}i
,
license:
%r{
\A
(
(un)?
licen[sc]e|copying)(
\.
[^/]+)?
\z
}i
,
contributing:
%r{
\A
contributing[^/]*
\z
}i
,
version:
'version'
,
avatar:
/\Alogo\.(png|jpg|gif)\z/
,
...
...
spec/lib/gitlab/file_detector_spec.rb
View file @
643c6f31
...
...
@@ -29,11 +29,15 @@ describe Gitlab::FileDetector do
end
it
'returns the type of a license file'
do
%w(LICENSE LICENCE COPYING)
.
each
do
|
file
|
%w(LICENSE LICENCE COPYING
UNLICENSE UNLICENCE
)
.
each
do
|
file
|
expect
(
described_class
.
type_of
(
file
)).
to
eq
(
:license
)
end
end
it
'returns nil for an UNCOPYING file'
do
expect
(
described_class
.
type_of
(
'UNCOPYING'
)).
to
be_nil
end
it
'returns the type of a version file'
do
expect
(
described_class
.
type_of
(
'VERSION'
)).
to
eq
(
:version
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment