Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task #876 - Add license_finder to template #138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The `-m` flag tells the generator to run our app [template](https://github.com/i
- Adds [Pry-Rails](https://github.com/rweng/pry-rails) to the Gemfile, inside of the development and test group
- 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
- Adds [Rspec-Rails](https://github.com/rspec/rspec-rails) to the Gemfile and initializes it
- Adds [License-Finder](https://github.com/pivotal/LicenseFinder) to the Gemfile and initializes it
- Initializes deploy script with [Mina](https://github.com/mina-deploy/mina)
- Initializes spring binstubs
- Updates the secrets.yml file to use Figaro and have defaults
Expand Down
23 changes: 23 additions & 0 deletions template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
gem 'brakeman', require: false
gem 'bundler-audit', require: false
gem 'rubocop-infinum', require: false
gem 'license_finder', require: false
end
HEREDOC
end
Expand Down Expand Up @@ -647,6 +648,15 @@ def run
on_warn: fail
required_executable: 'node_modules/.bin/stylelint'
command: ['node_modules/.bin/stylelint']

LicenseFinder:
enabled: true
on_warn: fail
command: ['bundle', 'exec', 'license_finder']
uncoverd marked this conversation as resolved.
Show resolved Hide resolved
requires_files: true
include:
- 'Gemfile*'
- 'package.json'
HEREDOC
end

Expand Down Expand Up @@ -718,3 +728,16 @@ def run

# Fix default rubocop errors
run 'bundle exec rubocop -A'

# add a list of permitted licenses to license_finder configuration file
run 'bundle exec license_finder permitted_licenses add "New BSD" "Simplified BSD" ruby "2-clause BSDL" ' \
'"Python-2.0" MIT "Apache 2.0" ISC CC0-1.0 CC-BY-3.0 "Mozilla Public License 2.0" LGPL MIT-0 ' \
'"Brakeman Public Use License" Apache "(CC-BY-4.0 AND OFL-1.1 AND MIT)" CC-BY-4.0 ' \
'"MPL-2.0 OR Apache-2.0" "(MIT AND Zlib)" "(WTFPL OR MIT)" "PayPal SDK License" ' \
'"MIT (http://mootools.net/license.txt)" "(MIT AND CC-BY-3.0)" 0BSD BSD '

# add a list of restricted licenses to license_finder configuration file
run 'bundle exec license_finder restrict add GPL-2.0 GPL-3.0'

# add bundle-audit gem to approved gems list
run 'bundle exec license_finder approvals add bundler-audit'