pre-commit-closure-linter 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd9aed8186e8e3dd7893ceb5243e6fbe1743aec4
4
- data.tar.gz: cfc11e01e7821e4a8b7b9a45f755edafa8e03363
3
+ metadata.gz: 568755d19e0f39600003a2be72fbc1fd4c927062
4
+ data.tar.gz: bc0bcd14672cee4e53b0903b5380e88243ad66e3
5
5
  SHA512:
6
- metadata.gz: 23f64f834ae22a7f7c8fb3a65cb7098359fa644af6f5868a6c18df4fb8932e2d445fee21a5b2871da48920c6395d828b9cb89a4452d5546fe61cbf52cab52adc
7
- data.tar.gz: b452e861a6d5fbf9d3acf6503714e9ae0785bf7a82318a9a9f984014ffb57ee3605d5261ea063b8e9a39234985e061c6a2c77bd5a6a133d803cd813547ba1355
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 --nojsdoc #{staged_files.join(" ")}`
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
@@ -1,6 +1,5 @@
1
1
  module PreCommit
2
2
  module ClosureLinter
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
6
-
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.1
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-13 00:00:00.000000000 Z
11
+ date: 2015-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pre-commit