Skip to content

Commit bd80f8e

Browse files
Merge pull request #138 from infinum/feature/876-add-license-scanning
Task #876 - Add license_finder to template
2 parents 5543575 + bd124f6 commit bd80f8e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The `-m` flag tells the generator to run our app [template](https://github.com/i
8080
- Adds [Pry-Rails](https://github.com/rweng/pry-rails) to the Gemfile, inside of the development and test group
8181
- Adds [Rubocop](https://github.com/bbatsov/rubocop), [RSpec-Rubocop](https://github.com/backus/rubocop-rspec) & [Overcommit](https://github.com/brigade/overcommit) to the Gemfile, inside of the development group
8282
- Adds [Rspec-Rails](https://github.com/rspec/rspec-rails) to the Gemfile and initializes it
83+
- Adds [License-Finder](https://github.com/pivotal/LicenseFinder) to the Gemfile and initializes it
8384
- Initializes deploy script with [Mina](https://github.com/mina-deploy/mina)
8485
- Initializes spring binstubs
8586
- Updates the secrets.yml file to use Figaro and have defaults

template.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
gem 'brakeman', require: false
298298
gem 'bundler-audit', require: false
299299
gem 'rubocop-infinum', require: false
300+
gem 'license_finder', require: false
300301
end
301302
HEREDOC
302303
end
@@ -692,6 +693,15 @@
692693
on_warn: fail
693694
required_executable: 'node_modules/.bin/stylelint'
694695
command: ['node_modules/.bin/stylelint']
696+
697+
LicenseFinder:
698+
enabled: true
699+
on_warn: fail
700+
command: ['bundle', 'exec', 'license_finder']
701+
requires_files: true
702+
include:
703+
- 'Gemfile*'
704+
- 'package.json'
695705
HEREDOC
696706
end
697707

@@ -783,3 +793,16 @@ def secrets
783793

784794
# Fix default rubocop errors
785795
run 'bundle exec rubocop -A'
796+
797+
# add a list of permitted licenses to license_finder configuration file
798+
run 'bundle exec license_finder permitted_licenses add "New BSD" "Simplified BSD" ruby "2-clause BSDL" ' \
799+
'"Python-2.0" MIT "Apache 2.0" ISC CC0-1.0 CC-BY-3.0 "Mozilla Public License 2.0" LGPL MIT-0 ' \
800+
'"Brakeman Public Use License" Apache "(CC-BY-4.0 AND OFL-1.1 AND MIT)" CC-BY-4.0 ' \
801+
'"MPL-2.0 OR Apache-2.0" "(MIT AND Zlib)" "(WTFPL OR MIT)" "PayPal SDK License" ' \
802+
'"MIT (http://mootools.net/license.txt)" "(MIT AND CC-BY-3.0)" 0BSD BSD '
803+
804+
# add a list of restricted licenses to license_finder configuration file
805+
run 'bundle exec license_finder restrict add GPL-2.0 GPL-3.0'
806+
807+
# add bundle-audit gem to approved gems list
808+
run 'bundle exec license_finder approvals add bundler-audit'

0 commit comments

Comments
 (0)