pre-commit-closure-linter 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/plugins/pre_commit/checks/closure_linter.rb +10 -1
- data/lib/pre-commit/closure-linter/version.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 568755d19e0f39600003a2be72fbc1fd4c927062
|
4
|
+
data.tar.gz: bc0bcd14672cee4e53b0903b5380e88243ad66e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aaeb895b96b70cdf4a0936ac00df0de387e4e609a92daf5a00f6ec291803fabf6cebc23bdaebe05c83b834ce10fc2ab2ce9ea5aff93b5dd63145b5fe62edee1
|
7
|
+
data.tar.gz: 26c674be7b5cce1c340b156b312274edc4786487989600b142c3da7aef397e8e4d09fd8af510fed80c45792b46b59efc3f3b376cccf7f851eb9e902957ce53b5
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[Closure Linter](https://developers.google.com/closure/utilities/docs/linter_howto) plugin for https://github.com/jish/pre-commit
|
1
|
+
[Closure Linter](https://developers.google.com/closure/utilities/docs/linter_howto) plugin for [Pre-commit](https://github.com/jish/pre-commit). It enables ability to check your Javascript code with [Google JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).
|
2
2
|
|
3
3
|
## Installation
|
4
4
|
|
@@ -25,3 +25,7 @@ Use the pre-commit command to enable the plugin
|
|
25
25
|
|
26
26
|
# In your git repo
|
27
27
|
$ pre-commit enable yaml warnings closure-linter
|
28
|
+
|
29
|
+
### Configuration
|
30
|
+
|
31
|
+
You can store your configuration options into a file named `.gjslintrc` and put this file in the root directory of your project. [Here](https://gist.github.com/tsevan/94bd649054b7c64181a3) you can find an example file. You can get the full list of all available options using `gjslint --help`.
|
@@ -8,16 +8,25 @@ module PreCommit
|
|
8
8
|
staged_files = staged_files.grep(/\.js$/)
|
9
9
|
return if staged_files.empty?
|
10
10
|
|
11
|
-
output = `gjslint
|
11
|
+
output = `gjslint #{gjslint_options} #{staged_files.join(" ")}`
|
12
12
|
return if output =~ /(\d*) files checked, no errors found(.*)/
|
13
13
|
|
14
14
|
output
|
15
15
|
end
|
16
16
|
|
17
|
+
def alternate_config_file
|
18
|
+
'.gjslintrc'
|
19
|
+
end
|
20
|
+
|
17
21
|
def self.description
|
18
22
|
"Runs closure linter syntax check"
|
19
23
|
end
|
20
24
|
|
25
|
+
def gjslint_options
|
26
|
+
return '' unless config_file
|
27
|
+
|
28
|
+
File.readlines(config_file).map(&:chomp).join(' ')
|
29
|
+
end
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pre-commit-closure-linter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitali Tsevan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pre-commit
|