Skip to content
Snippets Groups Projects
Commit 643c6f31 authored by J.D. Bean's avatar J.D. Bean Committed by Rémy Coutable
Browse files

Recognize 'UNLICENSE' license files

parent 4a14ff5b
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
---
title: Recognize 'UNLICENSE' license files
merge_request: 21508
author: J.D. Bean
type: added
Loading
Loading
@@ -8,7 +8,7 @@ module Gitlab
# Project files
readme: %r{\Areadme[^/]*\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{\Acontributing[^/]*\z}i,
version: 'version',
avatar: /\Alogo\.(png|jpg|gif)\z/,
Loading
Loading
Loading
Loading
@@ -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
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