overcommit 0.56.0 → 0.57.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6ecbb7e4b390f8d17c9058da38464b73f7cec50a87e494430e9c15a9c40ecff
4
- data.tar.gz: f90974df2fe0b918ff8711a228608ad1b312a730abd9ad7c45b02ee512daa496
3
+ metadata.gz: b5c35b43073b67da5cd0f8218c5ffd914b0601f1aac6d5ac9263ec3945893259
4
+ data.tar.gz: 9c08bf2a7153993c48e3d15f30dee2c846edbb5f8500f89a41e027ec80ffb767
5
5
  SHA512:
6
- metadata.gz: a8b55f73d42ca1791bbd6a01281a0adbbe1f57385721d9ec4905e98dd9217480ae5b10ff8e9083048953974d40c97d104f126ca9b514fb05359ba6c402b4bf7b
7
- data.tar.gz: b9263d9c65fbbeaa4cf7a38d5b7c2bb4af6d6ec7abf5e3ee22209a455a3b7529718b6eb9adbc14161539861420242093c7b4c3564e248ce84bc663cfb354899f
6
+ metadata.gz: 6cdcab7f4b31feed71b3f584f1e025a930d9b767e4e9acf00562ed57fac38442381454f57758bd967a657c9f966842f44212b53e2b482fe50613723590383d02
7
+ data.tar.gz: 6d763e1d1eca286dd9c8861ee265bd8b3ed29e740d10d430e82c461ae64b313ef2057b11db654c0f694c21dcefcf187b8e7ea27bfbf1a16eba3d6f47776b4772
@@ -275,6 +275,13 @@ PreCommit:
275
275
  - '**/*.ex'
276
276
  - '**/*.exs'
277
277
 
278
+ ErbLint:
279
+ enabled: false
280
+ description: 'Analyze with ERB Lint'
281
+ required_executable: 'erblint'
282
+ install_command: 'bundle install erb_lint'
283
+ include: '**/*.html.erb'
284
+
278
285
  EsLint:
279
286
  enabled: false
280
287
  description: 'Analyze with ESLint'
@@ -9,6 +9,6 @@ module Overcommit::Hook::CommitMsg
9
9
 
10
10
  def_delegators :@context, :empty_message?, :commit_message,
11
11
  :update_commit_message, :commit_message_lines,
12
- :commit_message_file
12
+ :commit_message_file, :modified_lines_in_file
13
13
  end
14
14
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Overcommit::Hook::PreCommit
4
+ # Runs `erblint` against any modified ERB files.
5
+ #
6
+ # @see https://github.com/Shopify/erb-lint
7
+ class ErbLint < Base
8
+ MESSAGE_REGEX = /(?<message>.+)\nIn file: (?<file>.+):(?<line>\d+)/
9
+
10
+ def run
11
+ result = execute(command, args: applicable_files)
12
+ return :pass if result.success?
13
+
14
+ extract_messages(
15
+ result.stdout.split("\n\n")[1..-1],
16
+ MESSAGE_REGEX
17
+ )
18
+ end
19
+ end
20
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Overcommit
5
- VERSION = '0.56.0'
5
+ VERSION = '0.57.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overcommit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.56.0
4
+ version: 0.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2020-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -130,6 +130,7 @@ files:
130
130
  - lib/overcommit/hook/pre_commit/credo.rb
131
131
  - lib/overcommit/hook/pre_commit/css_lint.rb
132
132
  - lib/overcommit/hook/pre_commit/dogma.rb
133
+ - lib/overcommit/hook/pre_commit/erb_lint.rb
133
134
  - lib/overcommit/hook/pre_commit/es_lint.rb
134
135
  - lib/overcommit/hook/pre_commit/execute_permissions.rb
135
136
  - lib/overcommit/hook/pre_commit/fasterer.rb