This is a developer tool designed to provide a consistant format for the Brad's Deals code base. It also adds checks for common issues like leaving debugging declarations in the code.The linter cover the following.
- Javascript ES5 & ES6 support
- JSON
- Ruby & Ruby on Rails
- SCSS & CSS
- YAML
Add this line to your application's Gemfile:
group :development do
gem 'bd_lint'
end
And then execute:
$ bundle
Add this snippet to the apps ./Rakefile
If the app is NOT rails
begin
require "bd_lint/rake_tasks"
rescue LoadError
puts "BD Lint Not Loaded"
end
Install/Update bd lint config:
$ bundle exec rake bd_lint:setup:app
Install pre-commit on your local copy of the application
$ bundle exec rake bd_lint:setup:local
If you are trying to merge or push a change out and temporarily ignore bundle audit, you can disable it by performing the following steps.
- Vist your Travis builds Repository
- Click
More options
/Settings
- Go to the
Environment Variables
section - Add
DISABLE_BUNDLE_AUDIT
with a value oftrue
- Re-run your travis build
- After your build completes successfully remove the variable from Travis
If you are merging a pull requests and deploying to staging wait until after your code is deployed before removing the variable from Travis.
If a gem has an open CVE with no viable long term fix and we need to ignore it without skipping all gems set the BUNDLE_AUDIT_IGNORE
as a comma delimited value of CVE's
- Vist your Travis builds Repository
- Click
More options
/Settings
- Go to the
Environment Variables
section - Add
BUNDLE_AUDIT_IGNORE
with a comma delimited list of CVE's - Re-run your travis build
If you wish to run checks without commiting you can run the following
$ bundle exec rake bd_lint:check
The command ensures checks will run on RMV
$ bundle exec rake bd_lint:rvm_check
Check an application for known security vulnerabilities in its Gems by running the following
$ bundle exec rake bd_lint:audit
If you wish to contribute create a separate branch and submit a pull request to the master branch.
The gem is available as open source under the terms of the MIT License.