guard-scss_lint 0.1.6 → 0.1.7

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: 17ffac50daaa0992ee3ef7379e238d815d6e7734
4
- data.tar.gz: 87102ec0186cdf7986cbfd11b06d07bc205105e1
3
+ metadata.gz: e83b9ea071a8f1bbda77598af3a1773c68394d76
4
+ data.tar.gz: b1612c88204510ebcabb936a64cfbced25499856
5
5
  SHA512:
6
- metadata.gz: 155b115613ebb73e4746b5d5b6ba9a95a3ca6f5ca811b5b0c5c38ba21769a61671def87952a50a85524a75515072734414b542966af25bb81f00a56f3cb4ecdd
7
- data.tar.gz: f6f13700bfa50ed4b667f88a6ae8ef9584becd4f87c1fb66b923bf02e297623217396ca9842e22c4df0edc6237b41304e63e47dd12ba14e3e98d74884103b9ca
6
+ metadata.gz: f62dfc7bf36dff4cef8f3e797b567aa82a5842b8cc43c13ab76bdf1bb61ac1be54f9c2c641234819fde936ec9a48768411146f17bd33a691f3cb47cfbfda5983
7
+ data.tar.gz: 743d722e511ec47df05d15528a6938f1d2e2d6d25e46b8dd682fce55d3c5d71fb94e59907d59a2b21fdbda0d550debc488bed63f4a61419f36c3426308ac10de
@@ -38,13 +38,31 @@ module Guard
38
38
  end
39
39
 
40
40
  def run_on_changes(paths)
41
- run paths.uniq
41
+ paths = paths.reject { |p| @config.excluded_file?(p) }.map { |path| { path: path } }
42
+
43
+ if paths.empty?
44
+ Guard::Compat::UI.info 'Guard has not detected any valid changes. Skipping run'
45
+ return
46
+ end
47
+
48
+ if paths.size == 1 && paths[0][:path] == scss_config_file
49
+ Guard::Compat::UI.info 'Detected a change to the scss config file only. Running Guard on all scss files'
50
+ run_all
51
+ return
52
+ end
53
+
54
+ Guard::Compat::UI.info "Running ScssLint on #{paths.reject { |p| p == scss_config_file }.uniq}"
55
+ run paths.reject { |p| p[:path] == scss_config_file }.uniq
42
56
  end
43
57
 
44
58
  private
45
59
 
60
+ def scss_config_file
61
+ @options[:config] || '.scss-lint.yml'
62
+ end
63
+
46
64
  def load_config
47
- config_file = @options[:config] || '.scss-lint.yml'
65
+ config_file = scss_config_file
48
66
  @config = if File.exist?(config_file)
49
67
  SCSSLint::Config.load config_file
50
68
  else
@@ -56,8 +74,6 @@ module Guard
56
74
  load_config
57
75
 
58
76
  @scss_lint_runner = SCSSLint::Runner.new @config
59
- paths = paths.reject { |p| @config.excluded_file?(p) }.map { |path| { path: path } }
60
-
61
77
  @scss_lint_runner.run paths
62
78
  @scss_lint_runner.lints.each do |lint|
63
79
  Guard::Compat::UI.send lint.severity, lint_message(lint)
@@ -1,3 +1,4 @@
1
1
  guard 'scss_lint' do
2
2
  watch(%r{^app/assets/stylesheets/.+.scss})
3
+ watch(/^\.scss-lint\.yml/)
3
4
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  class ScssLintVersion
3
- VERSION = '0.1.6'.freeze
3
+ VERSION = '0.1.7'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-scss_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Rohr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-25 00:00:00.000000000 Z
11
+ date: 2019-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard-compat