-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from shopsmart/enforce_linter
Enforce Linter
- Loading branch information
Showing
6 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
require "bd_lint/rvm_version" | ||
require "bd_lint/validator" | ||
require "pre-commit" | ||
require "plugins/pre_commit/checks/jscs" | ||
|
||
# Run this on application initialization | ||
BdLint::Validator.check | ||
BdLint::RvmVersion.check | ||
|
||
module BdLint | ||
def self.run | ||
RvmVersion.check | ||
PreCommit.run | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module BdLint | ||
class Validator | ||
GIT_HOOK_PATH = ".git/hooks/pre-commit".freeze | ||
|
||
class GitHookError < StandardError; end | ||
|
||
def self.check | ||
raise GitHookError, "Please run `bundle exec #{message}`" if invalid? | ||
end | ||
|
||
def self.invalid? | ||
!defined?(Rake) && !File.exist?(GIT_HOOK_PATH) | ||
end | ||
|
||
def self.message | ||
defined?(Rails) ? "rails g pre_commit" : "rake bd_lint:generate:pre_commit" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module BdLint | ||
VERSION = "0.2.1.4".freeze | ||
VERSION = "0.2.2".freeze | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters